The AWS Cloud service provides a very sophisticated service, and the messaging push service for mobile devices is also very good, very low cost, and good performance.
Although the AWS official web site has a lot of steps to explain, but I still take a big detour, mainly because there is so little contact with Google, so that the use of Google Cloud message to send a message in a circle.
First, the AWS official website documentation explains: http://docs.aws.amazon.com/zh_cn/sns/latest/dg/mobile-push-gcm.html
- GCM Prerequisites
- Step 1: Create a Google API project and enable GCM services
- Step 2: Get the server API key
- Step 3: Get the registration ID from GCM
- Step 4: Use GCM to send push notification messages to mobile endpoints
the first and second steps, in fact, are obtained from the Google website, not from AWS, which is the two-step comparison detours. And in the country must turn over the wall in order to view information. the third and fourth steps are done according to the documentation on the AWS official website.
mobile phone must have Google's service framework, and if it is a domestic mobile phone, the phone must turn over the wall to receive messagesStep 1: Create a Google API project and enable GCM services
Go to Google website, sign in to Google account (below is the official website document, translate in later)
Creating a Google API project
To create a Google apiproject:
1. Open the Google developersconsole.
2. If you haven ' t created an API project yet, click createproject.
3. supply a project name and click Create.
Oncethe Project has been created, a page appears that displays your project ID andproject number. For example, Project number:670330094152.
4. Copy down your project number. you'll use it later on as the gcmsender ID.
Enabling the Gcmservice
To enable THEGCM service:
1. in the sidebar to the left, select APIs &auth.
2. the displayed list of APIs, turn the googlecloud Messaging for Android toggle -On.
Translate: Create a Google API project
1 Open the Google Developer console: Https://cloud.google.com/console
2 If the API project has not been created, click CreateProject (Create Project)
3 Enter the project name and click Create
PS: Try not to take a space, project ID automatically generated
Once the project is created, it automatically jumps to the project details page, and you can see the project ID and project number, such as Project number:670330094152.
4 The project number is copied and will be used later as the GCM Sender ID.
Activate GCM Service
1 on the Left menu page, select APIs & Auth
2 in the list of displayed APIs, select Google Cloud Messaging for Android and set the switch to ON
Step 2: Get the Server API key obtaining an API key
To obtain an APIkey:
1. in the sidebar to the left, select APIs &auth > Credentials.
2. under public API Access, click Createnew key.
3. in the Create a new key Dialog,click Server key.
4. in the resulting configuration dialog, supply YourServer ' s IP address. For testing purposes, you canuse0.0.0.0/0.
5. Click Create.
6. in the refreshed page, copy the API key. You'll needthe API key later on to perform authentication in your application server.
Note: If youneed to rotate the key, click Regenerate key. A new key would becreated. If you think the key have been compromised and you want to delete itimmediately, click Delete.
Translation:
Get API Key
1 on the Left menu page, select APIs &auth > Credentials
2 on the Public API tab, select Create new key
3 on the Create a new key pair page, select Server key
4 in the Results confirmation page, enter the IP address of your service, if it is for testing purposes, you can use 0.0.0.0/0.
5 Click Create
6 after the refreshed page, copy the API key. The Application service platform in the back uses this API Key
Note: If you need to retrieve the API keyagain, click Regenerate key. will create a new Key . If you think the key is unsafe and want to delete it immediately, click Delete.
AWS SNS Mobile device Push service (GCM mode)