Same concept but much better features.
I need to say that the best news is that we can finally get push messages as fast as an iphone does. Put simply, we can now send to multiple devices the same push message in one request!!!!
That seems the best of the new apis, it was terribly annoying when we had to push one news entry to 20k android devices: the process took around 4-5 minutes in the perfect case even after optimization. At the same time, we could send the same message to 30k iphones in 5 seconds.
Now, the android team introduces what definitely made my day, GCM! even its name sounds cool.
Anyway, it seems most of the basics are still the same:
REGISTRATION:
- It is still based on intents and upon firing a registration intent (com.google.android.c2dm.intent.REGISTER), your app will receive an asynchronous broadcast (
com.google.android.c2dm.intent.REGISTRATION
) which will hand your app a registration ID, aka token. This token is used by your server to send messages to the device - I know this is old news but it is important to understand that it is not good practice to send the registration intent every time the app starts (I know people who do this). Actually, you should work on sending the registration intent once and saving the token that you receive in the broadcast receiver and, if you wish to, send it several time to your own push server for no good reason at all!
- Also, remember that your broadcast receiver's might receive multiple registration intents (onRegistered) and, therefore, your server must have the necessary apis to replace an old token with a new one which of course implies that this function could handle the situation where is it triggered whilst a token already exists (inform the server to replace it)
SENDING A MESSAGE:
- Your server should have an api key as usual to send the messages. The data sent is still the same old name-value pair format. Now the cool thing is the ability to send to up to 1000 devices per request (using json formatted request):
Content-Type:application/json Authorization:key=AIzaSyB-1uEai2WiUapxCs2Q0GZYzPu7Udno5aA { "collapse_key": "score_update", "time_to_live": 108, "delay_while_idle": true, "data": { "score": "4x8", "time": "15:16.2342" }, "registration_ids":["4", "8", "15", "16", "23", "42"] }
Notice that the tokens are sent as a json array and that the data is still encoded as a name value pair. collapse_key is still there and it is used to replace any old (unsent) message queued in the google servers having the same collapse_key with this message.
I am just happy and extremely happy that this has been implemented!!! Please check the Official Docs to implement fully. Congratulations everybody!
Related: How to implement GCM PhP Push Server for android
ReplyDeleteتعد الاول افضل شركة غسيل خزانات بالمدينة المنورة تعمل على استخدام افضل ادوات تنظيف وتعقيم خزانات المياه
Great Article. Thank you for sharing! Really an awesome post for every one.
ReplyDeleteJoint Cotask Aware Offloading and Scheduling in Mobile Edge Computing Systems Project For CSE
Mobile Edge Computing With Wireless Backhaul Joint Task Offloading and Resource Allocation Project For CSE
Mobile Intelligent Computing in Internet of Things An Optimized Data Gathering Method Based on Compressive Sensing Project For CSE
Multi Resolution Parallel Magnetic Resonance Image Reconstruction in Mobile Computing Based IoT Project For CSE
Non interactive ID based Proxy Re signature Scheme for IoT Based on Mobile Edge Computing Project For CSE
Private Data Acquisition Method Based on System Level Data Migration and Volatile Memory Forensics for Android Applications Project For CSE
RONFC A Novel Enabler Independent NFC Protocol for Mobile Transactions Project For CSE
Social Context Aware Mobile Data Offloading Algorithm via Small Cell Back haul Networks Project For CSE
Task Scheduling for Smart City Applications Based on Multi server Mobile Edge Computing Project For CSE
kd shoes
ReplyDeletegolden goose shoes
kyrie irving shoes
curry 7
supreme
cheap jordans
stone island outlet
yeezy boost 350 v2
yeezy boost 350 v2
kyrie 6
เรารวมเกมส์ Poker Online พร้อมวิธีการเล่นโป๊กเกอร์ ระดับมืออาชีพและรวมกลุ่มนักเล่นทั่วไทย ไว้ให้คุณพร้อมเติมเครดิตเล่นได้แล้ววันนี้ 24 ชม Poker is the #1 poker game in the world. Play with friends and see who's got the best poker face or come and meet some new buddies.
ReplyDeleteWonderful post! We will be linking to this great article on our site. I’m definitely delighted I found it and I’ll be bookmarking and checking back often! 메이저사이트
ReplyDeleteRecently, I have started to read a lot of unique articles on different sites, and I am enjoying that a lot. Although, I must tell you that I still like the articles here a lot. They are also unique in their own way
ReplyDelete온라인경마
경마사이트
Youre so right. Im there with you. Your weblog is definitely worth a read if anyone comes throughout it. Im lucky I did because now Ive received a whole new view of this. 먹튀검증사이트
ReplyDeletesteroid satın al
ReplyDeleteheets
İ4JQİ