Push Notifications

From Fuseboxx Wiki
Jump to: navigation, search

This page is under construction.

iOS

Fuseboxx™ offers the ability to schedule push notifications that leverage Apple’s Push Notification Service (APNS). To use this service, the application must request a push token that is passed to the Fuse API for storage. When a new notification message is scheduled, the Fuse system will send to each device for which there is a stored token.

You can add a new Push Notification Here, but you will need to set up the appropriate Certificate first Here .

Push Notifications Overview

Push notifications are usually the only means that a custom message can reach the player when they are outside of the application. They are typically used for time limited sales, new updates, or even game server maintenance windows.

An additional benefit to using the Apple Push Notification Service (APNS) is that after each notification is sent, FuseBoxx™ will poll the service to find out which notification failed to send, indicating which devices the application has been deleted from. This information keeps the total number of installed application up to date, and more importantly the number of devices that can be communicated with.

Feedback on the success of the notifications, such as the number of players who immediately opened the application upon receiving the notification, and those who received it while in the application, is also available via FuseBoxx™ (and can be viewed on the (Toolboxx Tab > Push Notifications > Statistics section) Here).

Integrating APNS

To collect notification token information, the API hooks the following application calls

 -(void) application:(UIApplication *)applicationdidRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
   [FuseAPI applicationdidRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
 }
 
 -(void)application:(UIApplication *)applicationdidFailToRegisterForRemoteNotificationWithError:(NSError *)error {
   [FuseAPI applicationdidFailToRegisterForRemoteNotificationWithError:error];
 }
 
 -(void)application:(UIApplication *)applicationdidReceiveRemoteNotification:(NSDictionary *)userInfo {
   [FuseAPI applicationdidReceiveRemoteNotification:userInfoApplication:application];
 {

For more information on setting up Push Notifications see Setting up Apple Push Notifications or our Usage Guide on Notifications

NoteBubble.png

If you do not wish to register for push tokens immediately, there is a way to start a session without registering Push Tokens See Here

Not registering for push tokens immediately means the permission popup will not appear until you register for push tokens

If you wish to register your Push Token you can make the following function call

 [FuseAPI registerForPushToken];

Android

Overview

FuseBoxx™ offers the ability to schedule push notifications that leverage Google's Cloud Messaging service. To use this feature you must have registered for GCM through Google's API portal: Link Here. A good explanation of GCM can be found Here.

Integration

<receiver android:name="com.google.android.c2dm.C2DMBroadcastReceiver"
       android:permission="com.google.android.c2dm.permission.SEND">
       <intent-filter>
           <action android:name="com.google.android.c2dm.intent.RECEIVE" />
           <category android:name="com.my.package" /> <!-- <<< Update this with your package ID -->
       </intent-filter>
       <intent-filter>
           <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
           <category android:name="com.my.package" /> <!-- <<< Update this with your package ID -->
       </intent-filter>
   </receiver>

NoteBubble.png

Set Up and Integration of Push Notifications on Android is covered in Google Cloud Messaging Setup.

Marmalade

Overview

For Android:

FuseBoxx™ offers the ability to schedule push notifications that leverage Google's Cloud Messaging service. To use this feature you must have registered for GCM through Google's API portal: Link Here. A good explanation of GCM can be found Here.

For iOS:

FuseBoxx™ offers the ability to schedule push notifications that leverage Apple's Push Notification Service. Click Here for an overview of the service. Before push notifications can be sent, Production and Development Certificates must be uploaded to FuseBoxx™ here:

https://www.fuseboxx.com/dashboard/pushnotifications/configure

Integration

To get Push Notifications working, you must replace notification_large.png and notification_small.png in FuseAPI/res/drawable with your own icons, The names must be the same.

notification_large is a 72x72 24-bit png

notifications_small is a 36x36 24-bit png

Once this is done, you can use the following function call to register for push notifications, enabling their functionality.

void FuseAPIRegisterForPushNotifications(const char* projectID);

projectID [const char*]: is the Project Number obtained after registering for GCM through Google's portal. The projectID value will be ignored on iOS.

If you are developing for Android:

In order to get push notifications working, you must navigate to FuseAPI/source/ExtraAppManifests.txt and replace com.fusepowered.marmaladesample with your application bundle ID. You must also navigate to FuseAPI/source/ExtraManifests.txt and replace com.fusepowered.marmaladesample with your application bundle ID for the two permissions.

Adobe Air

Overview

Push Notifications are handled by FuseBoxx™. Simply set up your accounts with Google or Apple and you can control them all from within FuseBoxx™.

Google Cloud Messaging

Apple Push Notification Services

Configure

A small amount of information is required by FuseBoxx™ to begin sending push notifications.

To set up your accounts with FuseBoxx™, Click here.

Android: You will need your app specific Google Cloud Messaging Key

iOS: You will need app specific Production and Development Push Certificates

Unity

Overview

FuseBoxx™ offers the ability to schedule push notifications that leverage either Google's Cloud Messaging service or Apple Push Notification Service.

If you are developing for android you will need to register for GCM through Google's API Portal. A good explanation of GCM can be found here.

You will need to use your GCM key or APNS certificates in the (Toolboxx > Push Notifications > Configure) section of FuseBoxx™.

Integration

To integrate push notifications, all you have to do is make sure the Register For Push Notifications box is checked on the FuseAPI prefab when it is in the scene. If you are developing for android you will need to put your GCM Sender ID in the text field.

UnityPushNotificationsIos.png

The box is checked by default so you shouldn't need to do anything.


Delayed Push Token Registration

If you wish to delay push token registration (this means the permission popup will not appear until you register for push tokens), you can uncheck the Register For Push Notifications in the FuseAPI prefab.

When you wish to register for push notifications, call the following code in your Unity script:

 #if UNITY_IPHONE
 FuseAPI_iOS.FuseAPI_RegisterForPushNotifications();
 #else if UNITY_ANDROID
 FuseAPI.SetupPushNotifications( "GCM_SenderID" );
 #endif