Start a Project

Android Push notification in china

GCM(Google Cloud messaging) don’t work in china.  But WHY ?

GCM is a derived from Google it should work in android devices irrespective of country.

The reason is from this source

GCM requires devices running Android 2.2 or higher that also have the Google Play Store application installed

Google Cloud Messaging (GCM) works with the Google Play Services SDK and as you probably know Google Play is not available in China (just like most of other Google services). ~Source2

 

Here is a list of some alternative for the GCM:

http://stackoverflow.com/a/17826007/5028508

 

This post will deal with implentation of https://pushy.me/ (Military-grade reliability and speed for push notifications)

Yes as the description say pushy service is reliable, speedy no doubt and also easy to implement

Check pricing (its not expensive however there are other free push  service available like JPush) and documentation .

Here is the procedure from document to implement Pushy notification

 

Get The SDK

Download the link of the latest sdk.

https://pushy.me/downloads/sdk/pushy-1.0.9.zip

 

Extracting the SDK

Extract the archive and copy the pushy-x.x.x.jar and pushy-jackson.jar files to your libs/ folder.

 

Import the SDK

Add this compilation statement in module level build.gradle file

 

Register a Device

  1. Synchronous call

  2. Asynchronous Example

Final Step

Add this initialization statement in the laucher activity

 

 

Set up manifest : Permissions, recievers and services

 

 

 

Implementing Broadcast Reciever for handling broadcast messages

 

 

 

Backend Configuration

For backend configuration visit https://dashboard.pushy.me/apps

Signup a account and create a application. You will be provided a secret key for each app.

 

Send Notification from Server

Here is a test script that send a notification on a particular RegisterId that was obtain in Register a device step

PushyNoficationTest.php

pushy.php

 

 

For more information check out the original documentation or leave a comment here.

For JPush Stay tuned!

 

Exit mobile version