Android Server Push Notification-Urban Airship

Source: Internet
Author: User


1. First, register an account in urbanairship. He has a free account available for 45 days.

2. After registration, create an app. The content can be simply entered.

3. After the app is generated, go to the property modification page and change the Android Package to the project Package name you want to use. If GCM support is required, you need to send an email to urbanairship. Generally, it will be approved soon. I will approve it the next day.

4. download the latest development kit on the urbanairship download page. Here I download version 2.0.1. Decompress the package and use eclipse to create a project. Select the PushSample directory to import the project.

5. change all the package names to the package names defined above (search for some, and there are many places ).

6. the project contains two files: AndroidManifest. xml and AndroidManifest-Helium.xml, we first use Helium to test, the original AndroidManifest. xml file changed to AndroidManifest-GCM.xml, AndroidManifest-Helium.xml changed to AndroidManifest. xml.

7. Modify the assets/airshipconfig. properties file and modify
The developmentAppKey is displayed on the app properties page.
The developmentAppSecret is displayed on the app properties page.
Transport = helium

8. Run AVD and the test program. Here I am using the android 4.1.2 Google APIs simulator. Find the APID in the log and remember its value. It will be used later. Select the "Push Enabled" check box for "Preferences" of the application.

9. Select the created app in unbanairship and select "Push"-> "APIDs" in the left-side Navigation Pane to view the registered devices.

10. in "Push"-> "Test Push Notification"-> "Android", output the previously remembered Apid in the form's APID, enter the message in alert, and then press the send button, the result is displayed on the simulator.

11. GCM support
11.1 if you want to use GCM support (refer to the http://developer.android.com/guide/google/gcm/index.html), you must first create a project at http://code.google.com/apis/console, and enter the Project ID in the app attributes of unbanairship.
11.2 rename the AndroidManifest-GCM.xml to AndroidManifest. xml, modify the assets/airshipconfig. properties file, the modified content is as follows, here you need to pay attention to is
The developmentAppKey is displayed on the app properties page.
The developmentAppSecret is displayed on the app properties page.
Transport = gcm
GcmSender = <Project Id> (obtained from google apis console)
11.3 run the android program again and then test it in unbanairship.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.