Push Notification with Unity in Android using App42 Backend as a Service

  • View
    3.290

  • Download
    0

Embed Size (px)

DESCRIPTION

Integrating App42 Push Notification service with Unity3D App. With Unity you can create rich, interactive entertainment or multimedia experience. This presentation will help you learn how to use Unity, Push Notification feature with App42 Backend as a Service APIs. Check out our website http://www.shephertz.com

Text of Push Notification with Unity in Android using App42 Backend as a Service

  • 1. Push Notification Service

2. Push NotificationsMessage Pop-UpIncrease User Engagement Latest UpdatesCalendar Events 3. Benefits of Push Notification Increases user-engagement e.g. In a turn-based game like Tic-Tac-Toe, it can notify a user of his turn (suppose he gets a phone call in between and forgets that he was playing!!) Allows to send messages to users even when the app is not running; thus helps in reminding them of your App Helps to build a fan community around your game by pushing to a targeted audience like your regular gamers Allows an App to notify its users of new events without needing to actually open it, i.e. by a sound or a screen pop up 4. App42 Push Notification supportsComing Soon!!& 5. Why App42 Push Notification? Our Push Notification API can be used to send crossplatform push messages to devices running on iOS, Android and Windows Phone with a single API callNo infrastructure & scalability worries Send Image/Text/URLs text-based Push Notifications Send messages in Channel Subscription Mode Send Scheduled Push as per Time-Zone Push Analytics Analyze your Push Campaign with App42 Analytics Evaluate the number of Push messages sent, delivered and opened. 6. Creating a channel & scheduling Push messages through AppHQ 7. Push Analytics A very useful feature that can track: How many Push Notifications were sent from your sideHow many were delivered, andPush Notification CampaignHow many users opened the message31%100%Sent Delivered OpenedThese analytics can be viewed from our AppHQ console.74%Why Push Analytics? When you use our Push Notification Service, each Push goes from the App42 server to GCM/APNS/MPNS and then to the user device. Delivery of Push Notification is not guaranteed even from the service provider Once delivered, there might be a chance that user just clears it without opening the messageThus, Analytics gives you a better insight of your Push Notification campaign. 8. Integrating with Unity on Android 9. A few easy steps Download the sample code from here. To use Push Notification Service in your App, go to Google console, click on services option and enable Google Cloud Messaging for Android service. Click on API Access tab and create a new server key for your application with blank server information. Go to AppHQ console(Click here)and click on Push Notification and select Android setting in Settings option. Select your App and copy server key that is generated by using Google API console, and submit it. 10. Contd.. Open the PushSample.unity from your assets folder, it contains PushSample.cs & Constants.cs. Open Constants.cs file in Sample App and make these changes:Change API-Key and Secret-Key that you have received.Change Project-no. with your Google Project Number.Change Game Object Name with your Game Object on which you have to receive Notification Call-Back from Android.Change Call-Back Method with your method name on which you have to receive Notification Call-Back from Android e.g. Success. 11. Testing Sending messages using AppHQ console After registering for Push Notification, go to AppHQ console, click on Push Notification and select application after selecting User tab.Select desired user from registered User List and click on Send Message Button.Send appropriate message to user by clicking Send Button.Now you will get same message on your android device and your Call-Back Method of Unity3D.Sending messages using App42 API Pass the User Id and Message in below method: 1 PushNotificationService pushService=App42API.buildPushNotificationService(); 2 pushService.sendPushMessageToUser(userId,message); 12. Sending a message through AppHQ console 13. Changing Default Package Name Default package name of App42 push unity sample project is com.shephertz.app42.android.pushservice. To change this package name you have to modify the library project and rebuild it for your own package name. Here are the steps to perform it: Download the library project from here. Import this project in your eclipse. Change/refactor the package name of the android library project source with your desired game package name. While refactoring, select Update fully qualified names in non-Java text files (Forces Preview) option. This will modify AndroidManifest.xml file too with new package name. 14. Contd.. Cross check AndroidManifest.xml file for changes in package name; If not done, do it manually. Build your library project. Copy App42PushService.jar and AndroidManifest.xml file from your bin folder of library Project folder and replace/paste it into AssetspluginsAndroid of your Unity project. In Unity Project, select File option from menu and than select Build settings. Click on Player Settings-->Other SettingsIdentifie-->BundleIdentifier modify default package name (com.shephertz.app42.android.pushservice) with your package name that you have used while building the library project. 15. IT IS THAT SIMPLE!!! 16. Some useful links Getting Started:Downloads:Quick Start GuideApp42 Cloud SDKsSign-up for FreeApp 42 ModulesGame Development CenterBlogs: Concepts:Why BaaS?Backend as a ServicePush Notification for iOSMassive Multiplayer Gaming EnginePush Notification for AndroidApp AnalyticsReal-time Multiplayer Games using Unity3D Integrating Facebook in your Android AppProducts:Making a Turn-based GameApp42 Cloud APIs - BaaSUsing Query InterfaceAppWarp Multiplayer Gaming EngineWhen to use NoSQL?AppHQ Management ConsoleAdd Social to your GameAppHawk Project Management Tool AppClay Custom App Builder 17. Links for Reference : http://www.shephertz.com http://api.shephertz.com http://appwarp.shephertz.com http://app42paas.shephertz.comContact: sales@shephertz.com Skype: ShepHertzFollow us on: