Skip to end of metadata
Go to start of metadata

Add the Xamarin SDK to your reference

On both project Android/iOS of your own project you will need to add as reference the Accengage Plugin available on NuGet. 

Right click on Reference (on both iOS/Android side) and choose Manage NuGet Package, then search Xamarin.Accengage SDK and add it.

Then we recommend you to create a class in a SharedProject which will allow you to only have one class to handle the majority of methods 

you need to run properly our SDK, on iOS and Android side at the same time, since the SharedProject will search the method and adapt on the

environnement he is in to choose the working one.

Using

Using AccengageSDK at the top of your AppDelegate (iOS) or Activity (And) and any of your class:


Android Integration

Prerequisites

  • Compile using AndroidVersion 6 

To use all the potential of the android SDK, some additionnal integration step needs to be done.

Put our service tag insinde your application tag with the proper senderId, partnerID and privateKey.

AndroidManifest.xml

Inside all your Activities, you will need to  Sub Classing any Activity Type.

Following permissions are required in your manifest :

AndroidManifest.xml

Finally you need to add in your manifest inside the application tag our GCMHandler,

AndroidManifest.xml

A4SProvider,

AndroidManifest.xml

and NotificationActionsReceiver:

AndroidManifest.xml

Plugin

 Prerequisites

 To use all of our plugins you will need to setup your compiled android version to 7 since google play services 9.6.1 used the Android.Support.v4 24+ 

Xamarin.Accengage.Android.Plugin Play Services v1.0.1 :

    This plugin allows the SDK to:

  • Register/Unregister to GCM using GooglePlayServices (official and recommended Google's method)
  • Retrieve and send to Accengage the Google Advertiser ID (IDFA) automatically
  • Geolocation using GooglePlayServices (SDK 3.1.0+). Usefull about power comsumption.
  • Geofencing using GooglePlayServices (SDK 3.1.0+)

    This plugin regroup five plugins which you can import in your project separately in fonction of what you need :

  • Xamarin.Accengage.Android.Plugin Play Services Base 1.0.3
  • Xamarin.Accengage.Android.Plugin Play Services Location1.0.3
  • Xamarin.Accengage.Android.Plugin Play Services Push 1.0.3
  • Xamarin.Accengage.Android.Plugin Play Services Geofence 1.0.3
  • Xamarin.Accengage.Android.Plugin Play Services AdvertiserId1.0.3

Xamarin.Accengage.Android.Plugin Beacon v1.0.0

    This plugin allows the SDK to:

  • Listen for Beacons
  • Trigger In-Apps and Local Notifications using Beacons

 

Xamarin.Accengage.Android.Plugin Badger v1.0.0

    This plugin allows the SDK to:

  • Manage badge on all layer

 

iOS Integration

To use all the potential of the iOS SDK, some additionnal integration step needs to be done.

Prerequisites

  • XCode 8
  • iOS 8 and higher.

Configure push notifications

Push notifications allow an app that isn’t running in the foreground to notify the user when it has information for them. Push notifications originate from a notification server that you manage and are pushed to your app on a user’s device by the Apple Push Notification service (APNs).

First, you enable push notifications in the Xamarin project.

After you enable push notifications, generate and export a TLS certificate.

Enable push notifications

Please ensure that in the Entitlements.plist file, your Push Notifications entitlement is checked.

 

Creating and using certificates 

Please follow this Xamarin documentation link to learn how to create a certificate, associate it with a provisioning profile, and then get a Personal Information Exchange certificate.

Configure URL schemes

Creating an URL schemes

Deep Linking is becoming very important, it's a great way to enhance the effectiveness of you app's marketing campaigns.

It will allow you to open a specific view of your app from another app, from a push message, from an in-app message

or even from a website to your app.

To take advantage of it, you must create a custom URL Scheme associated with your application. A URL scheme lets you

communicate with other apps through a protocol that you define. To find out more, check out Apple documentation

To register your URL Scheme:

  1. Open your Info.plist and select the Advanced tab.
  2. Click Add URL Type in the URL Types expander.
  3. In URL Schemes field, enter your_app_url_scheme.
  4. Assign a unique identifier to the scheme to ensure uniqueness and avoid name collisions, so we'll use com.myapp.url for the example. 

To verify that everything works:

  1. Run your app.
  2. Open Safari on the same device.

Type your_app_url_scheme:// in the address bar, then press Go.

Whitelisting URL Schemes

Like ATS, iOS 9 introduces changes that impact URL Scheme management. For more details, you can consult Apple's documentation.

Make sure that your application Info.plist includes the LSApplicationQueriesSchemes set with the Log App's URL scheme.

Configure logging

Configure logging application

Accengage provide an application to help your team to identify for sure their device profile among the others, which is helpful for push notifications tests. It also allows our technical team to properly investigate in case of unexpected behavior. We strongly recommend it.

Note

This configuration is mandatory if Accengage teams need to test the SDK integration.

In order to be able to use our application, you will need to:

  1. add the scheme bma4sreceiver to the schemes whitelist as explained in the previous section.
  2. add a localhost exception to the App Transport Security key in your info.plist.
Enabling console logs

For diagnostic purposes, the library contains an option that turns on logging. These logs allow you to gain more insight on the library's integration and ensure it's working as expected. These logs can also be helpful for support staff who are troubleshooting problems.

Configuration File

First, get an empty configuration file to add to your project from this link.

Drag the AccengageConfig.plist file you just downloaded into the root of your Xamarin iOS project and add it to all targets then complete it with your own partner id and private key.

Right-click the file and set Build Action to BundleRessource.

 

Initialization

Now you're ready to begin implementing. Start the library in your AppDelegate FinishedLaunching method.

Import natives methods

If a feature is not available in the wrapper, You can directly use the binded sdk as if you coded natively. Use this namespace.

    • No labels