Android server push notification-Urban airship

Source: Internet
Author: User
Link: http://blog.csdn.net/kongxx/article/details/8155916

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 assets/airshipconfig. in the properties file, modify the developmentappkey. On the app properties page, you can see developmentappsecret. On the app properties page, you can see transport = helium8. run AVD and test programs. 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 need to use GCM support (refer to the http://developer.android.com/guide/google/gcm/index.html), you need to first create a project in http://code.google.com/apis/lele, and fill in the Project ID in the app attributes of unbanairship. 11.2 rename AndroidManifest-GCM.xml to androidmanifest. XML, modify assets/airshipconfig. properties file. The modified content is as follows, note that the developmentappkey can be viewed on the app properties page. The developmentappsecret can be viewed on the app properties page. Transport = gcmgcmsender = <Project ID> (obtained on the Google APIs console) 11.3 run the android program again and then test it in unbanairship.

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.