Our documentation is changing, please click here to enjoy it!

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Android

To enable push follow our android documentation to create a FCM project if you don't have one. Otherwise, follow our android documentation to migrate your GCM project to FCM.

Prevent Rich Push Notifications display

You can prevent the display of any RichPush notification, by calling: 

Code Block
A4S.Get(Context).PushNotificationLocked = true;

To reenable the RichPush Notifications, you can call:

Code Block
 A4S.Get(Context).PushNotificationLocked = false;

You can enable/disable RichPush notifications at any time.

 

iOS

Registering

In order to register for user notifications, you can call the registerForUserNotificationsWithOptions() method. This means that you're no longer required to maintain the registration by yourself, just call this method and the library will request notification authorization for you.

Note
iconfalse
titleImportant

Your must register for user notifications every time your app is launched.

Code Block
languagec#
// Register for notification
AccengageIOS.ACCNotificationOptions options = (AccengageIOS.ACCNotificationOptions.Alert | AccengageIOS.ACCNotificationOptions.Badge | AccengageIOS.ACCNotificationOptions.Sound);

AccengageIOS.Accengage.Push.RegisterForUserNotificationsWithOptions(options);

 

The Xamarin plugin supports iOS 12 provisional authorization. You can register this way by using following options :

AccengageIOS.ACCNotificationOptions.AuthorizationOptionProvidesAppNotificationSettings

AccengageIOS.ACCNotificationOptions.NotificationOptionProvisional

Code Block
languagec#
// You can add these parameters to register options.
options |= AccengageIOS.ACCNotificationOptions.AuthorizationOptionProvidesAppNotificationSettings; // to activates the provisional authorization.
options |= AccengageIOS.ACCNotificationOptions.NotificationOptionProvisional; // to indicates that the system should display a button for notification settings.

AccengageIOS.Accengage.Push.RegisterForUserNotificationsWithOptions(options);

 

You can get more information informations about this feature in the native iOS SDK documentation.

Media attachments

iOS 10 introduces support for rich notifications, it adds the abitity to send push with media attachments such as images, sounds and videos.

Info

Rich notifications are available on iPhone 5s or later, iPad Pro, iPad Air or later, and iPad mini 2 or later.

To enable this functionality, you will need to create a Notification Service Extension.

Note
iconfalse
titleImportant

Only work with Xamarin.iOS 10.4 and higher.

  1. Once your notification service is created, add the nuget package Xamarin.Accengage.iOS.Extension in extension.
  2. Inherit from ACCNotificationServiceExtension in NotificationService and delete all the code generated by Xamarin.
Code Block
languagec#
using Foundation;
using AccengageExtensionIOS;

namespace AccengageNotificationService
{
    [Register("NotificationService")]
    public class NotificationService : ACCNotificationServiceExtension {}
}

It is possible to disable the display of push using :

Code Block
SetPushServiceDisabled(true)