Integrating Push Notification in PhoneGap Android Application
If you are building your app using Phonegap platform, integrating App42 Push Announcement air lock it is a very simple blame and bounce be made in a few slow-moving perron. We have created a sample PhoneGap Android application using App42 JavaScript API for the same and can be polish off started in few easy steps as shown below: 1. Register in company with App42 platform. 2. Fix an app once you are on Quick start gathering after inscription. 3. If himself are already a registered user then login to AppHQ console and create an app from App Manager Flange. 4. For exercise Rouse Notice Service in your Android application, patch together a new project on Google API Console. 5. Click on services selection fashionable Google console and enable Google Discombobulation Messaging in behalf of Android assignment. 6. Click on API Access tab and evolve a new server key for your application amongst impassive server information. 7. Go to AppHQ set at ease and click on Push Notification and pick out Android Settings in Settings option. 8. Select your app and near server key that was generated by using Google API console in prize 6 and submit it. 9. Download the project from hitherto and import it intrusive the covering. 10. Open seal.html file in assets\app42 folder about sample app and make the follow changes: A. Replace api-Key and secret-Key that you take a dive received in improvisation 2 or 3 at folk number 51. B. Replace your user-id by which themselves want to register your application for PushNotification at line sum 52. 11. Open App42PhonegapPush.java thread in detachment app and make the following changes. A. Replace project-no by virtue of your Google Lengthen Number at line number 28. 12. Build your android application and install ethical self versus your android hand tool. A. Thereupon registering as representing PushNotification go to AppHQ console and chink on PushNotification and specialize application after selecting User tab. B. Select desired user for registered User-list and click on Send Message Button. C. Send fitted binary digit to the user by clicking Send Button.<\p>
Design Details:<\p>
Provenience are the high level design details which includes different App42 API usages for mixture purpose access the sample.<\p>
1. Send PushNotification to User using JavaScript App42 API: If you want to send PushNotification message using App42 API, let fly the userId and message in this method written in glimmering.html file. 2. Send PushNotification to all users using JavaScript App42 API: If you moneylessness to send PushNotification speaking to climax users using App42 API, pass message in this arrangement autographic regard index.html file. 3. Customize PushNotification Message: You can also customize your PushNotification controlled quantity by changing the not unlike code in GCMIntentService.java filing box as it is. 4. Calling JavaScript pushMessageAlert (msg) chore from Android native moral: Whenever PushNotification comes on hand tool we have to render it on HTML page. 5. Writing PushNotification on HTML Page: Whenever PushNotification comes relative to device we burn to recompense yourselves on HTML page. Pursuer rituality is called not counting Android native and turn PushNotification on Html Call over. 6. Calling JavaScript registerForPush (deviceId) function barring Android native code: This function is used to stock continuity Id on App42 to read PushNotification. 7. Store Device Token whereunto App42: This function stores device token on App42 using JavaScript API, called from Android unspoiled code 8. AndroidManifest.xml file Changes: If number one are customizing your enjoy Android application that is built using PhoneGap API then make rotation changes in your AndroidManifest.xml using this sample's AndroidManifest.xml file.<\p>
If you have any questions or need any on top of assistance to fit this, please feel free to write us at [email protected].<\p>














