Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Push通知を届けるために
futabooo
July 14, 2015
Programming
1
3k
Push通知を届けるために
futabooo
July 14, 2015
Tweet
Share
More Decks by futabooo
See All by futabooo
futaboooo
0
300
futaboooo
1
330
futaboooo
2
170
futaboooo
19
16k
futaboooo
2
1.6k
futaboooo
1
1.7k
futaboooo
5
6.4k
futaboooo
0
4.1k
futaboooo
1
1.3k
Other Decks in Programming
See All in Programming
yumcyawiz
4
640
aratayokoyama
0
210
line_developers_tw2
0
720
osyo
1
370
line_developers_tw
0
550
asumikan
0
290
shigeruoda
0
480
kazaman97
0
180
pdone
0
210
showwin
0
130
jun0
3
650
akatsukinewgrad
0
190
Featured
See All Featured
chriscoyier
780
240k
mthomps
39
2.3k
denniskardys
220
120k
kneath
219
15k
destraynor
223
47k
rasmusluckow
318
18k
pedronauck
652
110k
frogandcode
127
20k
keithpitt
401
20k
chrislema
173
14k
erikaheidi
13
4.2k
tanoku
86
8.5k
Transcript
Push௨Λಧ͚ΔͨΊʹ #potatotips 19 @futabooo
About me futabooo (Takahiro futagawa) - Engineer @eureka - Android
Developer - ࠷ۙΓΛײ͍ͯ͡Δ͜ͱ - ΫϥυϑΝϯσΟϯάͰߪೖͨ͠ ೣࣖܕϔουϑΥϯͷ։ൃԆ 4݄ૹ → 10݄ૹ http://www.axentwear.jp/
About eureka
ࠓ͢͜ͱ
ࠓ͢͜ͱ - InstanceID - RegistrationID(iOSͰ͍͏σόΠετʔΫϯ) - τϥϒϧγϡʔςΟϯά
GCMʹ͍ͭͯ
GCMͷྲྀΕ https://developers.google.com/cloud-messaging/gcm - ࣄલʹRegistrationIDΛอଘ - αʔό͔ΒRegistrationIDΛͬͯ PushΛૹ৴ RegistrationID
GCMͷ࣮ʹ͍ͭͯ - ࣮ํ๏ެࣜυΩϡϝϯτࢀর https://developers.google.com/cloud-messaging/android/legacy-regid - ΞϓϦΞοϓσʔτͰRegistrationID͕ มߋ͞ΕΔͱ͜ΖΧόʔ - ͷ࠶ىಈͰมߋ͞ΕΔ߹͕͋Δ
αʔόʹมߋޙͷIDΛૹΒͳ͍ͱ ಧ͔ͳ͘ͳΔ
ͷ࠶ىಈʹରԠ <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> AndroidManifest.xml <receiver android:name=".BootReceiver"> <intent-filter> <action
android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver>
ͷ࠶ىಈʹରԠ BootReceiver.java @Override public void onReceive(Context c, Intent i)
{ //RegistrationIDͷ࠶ొॲཧ }
τϥϒϧγϡʔςΟϯά
τϥϒϧγϡʔςΟϯά - GCMஅ https://support.google.com/googleplay/android-developer/answer/2663268
τϥϒϧγϡʔςΟϯά - GCMஅ εςʔλεʹΑͬͯMessage͕ਖ਼ ৗʹಧ͍͔ͨͲ͏͔֬ೝͰ͖Δ
͓·͚
͓·͚ - અిΞϓϦ - ͷઅిػೳ - wifiͷஅ - Serviceͷఀࢭ Push௨Λಧ͚ΔͨΊͷઓ͍ଓ͘
- DozeϞʔυ
Thank you :)