Troubleshooting

Check the SDK logs using our ACC info app

Our Acc info app can be used to check our SDK logs and find your device ID.

This article explain how to download this app, connect it to your application and find your device ID.

We offer the possibility to activate our SDK logs. Two levels of logs are available. Once activated, you can click on the 'LOGS' button in order to activate the logs tracking.

In order to see the logs directly on a Desktop, you can type the URL

Desktop logs : 

From the app, you can press the 'SEND' button to automatically send us the logs file within a mail :

SplashScreen

To prevent the display of any Accengage content, you can use the following methods in the OnCreate() method of your SplashScreen :

  • setPushNotificationLocked(true)
  • setInAppDisplayLocked(true)

Once you want to allow again the display of Accengage content use the following methods on your next Activity :

  • setPushNotificationLocked(false)
  • setInAppDisplayLocked(false)

Activate logs

Something doesn't work? You can enable logging in order to see what is going on.

To do so, simply add the following string:

strings.xml

<resources>
    // ...

    <string name="acc_logging">true</string>
</resource>

Plus, you can disable the toast displayed when application is started (because of UI Automation for example):

strings.xml

<resources>
    // ...

    <string name="acc_logging">true,no-toast</string>
</resource>

Find your A4SID (or Device ID or Mobinaute ID)

If you need to get the Accengage Device ID (or "Mobinaute Id") of the user, use the following method:

getA4S().getA4SId(new Callback<String>() {
    @Override
    public void onResult(String result) {
        // result is the A4SID returned by A4SSDK for this user
    }
});

Fullscreen Activity with notification and navigation bar

Your InApp appears under your notification bar and your navigation bar ? Here are two solutions :

1°) You can use the InApp display customization to include your inapp into a specific view in your layout.

2°) You can use our method A4S.setOverlayPosition(layoutParams) to add margin to the inapp like that :

@Override
protected void onResume() {
    super.onResume();
    getA4S().startActivity(this);
    FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
    layoutParams.setMargins(leftMargin, notificationBarSize, rightMargin, navigationBarSize);
    getA4S().setOverlayPosition(layoutParams);
}

Which ratio you need to use with the BigPicture template?

If you are using BigPicture for your push notifications, we advice you to choose a ratio of 2 (width) X 1 (height).

It correspond to an average height. Each device could have different dimensions.

But, the ratio 2 is the adviced ratio to have a correct display on a large sample of devices.

The image would be reduce only on the height. That's why it is advized to center the information on the image.

Do not forget : the more text lines you have in your Push content, the more the image will be reduced.

Disable Badges (3.5.0+)

If you want to disable Badges feature (because too many permissions are asked for example), exclude our Badge plugin from the Accengage SDK dependency:

dependencies {
    compile('com.ad4screen.sdk:A4SSDK:x.y.z') {
        exclude group: 'com.ad4screen.sdk', module: 'A4SSDK-Plugin-Badger'
    }
}

How to avoid a double splashscreen display with a rich push?

Sometimes it happens that a double splashscreen is launched during the sending of a rich push parameters with an URL Scheme as a deeplink.

Please find here the technical solution to solve this point :

  • The URL Schemes (intent-filter) are managed by your SplahScreen
  • The SplashScreen integrates the SDK
  • Lock only the in-apps display on your SplashScreen (in the method onCreate) : getA4S().setInAppDisplayLocked(true);
  • Your SplashScreen needs to detect that it is launched by an Accengage notification and in this case : DO NOT trigger an action (even close it)

In the method onResume(), you can use this code for instance :
Bundle bundle = getIntent().getExtras();
//

  • We recover the Payload in case if you would treat custom params at this level.

Bundle payload = bundle.getBundle(Constants.EXTRAGCMPAYLOAD);
if(payload == null) {
}
getA4S().startActivity(this);

  • Your SplashScreen has to be in launchMode singleTask or singleTop not launch it again during the launching of the URL Scheme by the SDK.
  • Unlock in-apps messages on the destination activity.

If this answer do not solve your problematic, do not hesitate to contact us via our form.

How to migrate your project from GCM to FCM

As of April 10, 2018, Google has deprecated Google Cloud Messaging (GCM). This gateway will no longer be available to broadcast Push Notifications to your users as of April 11, 2019.

If you're using a GCM project in your application, you will need to migrate it to the new gateway: Firebase Cloud Messaging (FCM).

In order to help you successfully migrate, please follow the steps below :

  1. First of all, follow the steps described in this article. Once done, come back to this page.
  2. To test your integration, activate logs and start your application. You will see the following line in the logcat, meaning that the plugin-firebase-messaging is correctly loaded :
    A4S|DEBUG|AppClient|Trying FCM plugin
    A4S|DEBUG|PluginLoader|com.ad4screen.sdk.plugins.fcm.FCM loaded
    A4S|INFO|FcmPushPlugin: FCM plugin is loaded
  3. To ensure the plugin is correctly used by your application, you have to check in the logs that the token is registered by FCM:
    A4S|DEBUG|FCMPushProvider|register
    A4S|DEBUG|FCMPushProvider|Registering application 'my.packagename' with FCM with senderID : '0123456789'...
  4. Once you have tested your integration, remove the line below from our plugin google-play-services
    compile('com.ad4screen.sdk:plugin-play-services-push:x.y.z')
  5. Now, you have to remove the lines below from your manifest :
    <receiver android:name="com.ad4screen.sdk.GCMHandler"
             android:permission="com.google.android.c2dm.permission.SEND" >
    <intent-filter>
       <action android:name="com.google.android.c2dm.intent.RECEIVE" />
       <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
       <category android:name="your-package" />
    </intent-filter>
    </receiver>
  6. You need to send a test notification to ensure that everything is working properly

Congratulations, your migration is complete !

  1. Add a custom FirebaseMessagingService by following this documentation. Once done go back to this page.
  2. Now report the way you use to handle push notification in your app through your custom GCMHandler into the custom FirebaseMessagingService
  3. When all the rules are reported, remove your custom GCMHandler from your application and your manifest
  4. You need to send a test notification to ensure that everything is working properly

Congratulations, your migration is complete !

How to find Sender ID and API Key for FCM/GCM?

Add Firebase Server key and Sender ID to Accengage dashboard

Accengage servers need Server API key and Sender ID of your FCM/GCM project to send push notifications.

Find GCM Sender ID

Find GCM Server key

How to find the SDK version you're using?

There are two main ways to find the sdk version you're using and the first one is programmatically. You can access the static variable "SDK_VERSION" in the Constants Class like this:

Constants.SDK_VERSION

The second way is to find the version directly inside the Logs of the app. To do so, make sure that you activated them, launch your app and read the logs.

The very first line will look like this:

A4S|INFO|A4S SDK VERSION : A3.1.2

Of course, "A3.1.2" is an example and the value you will get here is the version number of the SDK you integrated

How to incorporate Accengage with others CRM tools?

If you use several CRM tools (and the GCM recording is already done several times), this could explain why some devices do not receive push messages.

Indeed, a conflict can happen when it comes to the recording and the token recovered by the SDK could be invalid.

To resolve this problem, you can :

  • Leave our SDK records to GCM and no longer do it yourself

or

  • Send us the token after the recording from GCM

Regarding the second issue, please find the process below :

It is necessary to remove the following metadata in the Manifest :

<meta-data android:name="com.ad4screen.senderid" android:value="gcm:yoursenderid" />

Thus, the SDK won't be recorded automatically to GCM.

In this case, you have to record the application yourself to GCM and give us the token through this method :

sendGCMToken: http://wiki.accengage.com/android/javadoc/reference/com/ad4screen/sdk/A4S.html#sendGCMToken(java.lang.String)

If you want to use a deeplink referring to a pre-selected path in a mapping application, here are the different URL to use:

- Google maps:

  • Address: google.navigation:q=31+rue+du+quatre+septembre,+Paris
  • GPS cordinates: google.navigation:q=latitude,longitude

You will have to choose the action URL scheme for in-app or browser for push.

Note that when you use spaces in your URL, you have to replace them by "+".

How to manage the icon display into a push notification?

On Android, there are several ways to select the icon for a push notification.

First of all, there are three types of icons on Android with Accengage:

1. The first one is the default "ic_launcher" icon.

This icon is defined at the beginning of the app creation.

The logic is that the default icon is sent into a push notification, from Android 2.3 to 5.1.

However, from Android 4.4, Google has changed its criteria for the icon.

Indeed, the OS implements a filter (white color) on the icon.

The problem that you can encounter is that the icon has no transparency, which means that when a notification appears, the icon is not displayed. (cf. below)

2. In order to get around this change from Android 4.4, you have to make a change into your Android Manifest.

The icon has to be with white color and transparency.

Please have a look to our documentation: Android Manifest changes

After that, when you send a push:
--> users under Android 4.4 will receive the icon number 1
--> users above 4.4 will receive the second icon

3. The third one is the icon that you could add in a push message on the dashboard.

Finally, the third point will be taking in priority even if the first and the second point are integrated.

How to recover your Device ID (IDFV) on Android?

The Device Id is our unique identifier, it allows you to identify for sure the Accengage device profile that represent your own device. For test segments it is recommended to use this data as criterion. It is also necessary to get your device information from our Test Tools.

You will find below the methodology in order to recover your Device ID (A4SID) on Android :

  • Download the A4SID application on your Android device using the link below or using our QR Code:

https://wiki.accengage.com/android/downloads/A4SID.apk

  • Make sure your app has been opened at least one time.
  • Open the A4SID application and check your deviceID.

Here is an example for the creation of your test segment

 

How to use the geolocation minimizing battery consumption?

When the geolocation is active on the application and on the SDK, the SDK will constantly use the GPS which will need battery.

To avoid this, you can desactivate the automatic geolocation and activate the "manually mode" only when you wish.

For further information, do not hesitate to consult our documentation :

Documentation Accengage - Geolocation

How to visualize network requests from Accengage SDK ?

Since SDK 3.1.8 and 3.2.2, we added tags to network requests to be able to visualize them through DDMS Network Statistics, for example :

The Accengage SDK uses the 0x00413453 tag.

Import Android token history requirements

If you already used to send push notifications before integrating the Accengage SDK, you may want to import the history of push tokens in order to reach your existing app owners with Accengage messages even if they did not update/open the app having our SDK integrated yet.

In order to make sure your token base will be compatible with our solution, it's important to check the following points :

1- Continuity of your Sender ID

On Android, the push token (mandatory information to deliver a push notification on Android devices) is linked to the Sender ID & the Google API Key of your Project. It's also unique to a device. Changing your Sender ID means that the previous tokens will no longer be valid. In that case, if the user re-open the app a new token will get generated.

In order to make sure that your app owners will not get a new token generated after integrating the Accengage SDK, you need to check if your previous push solution manages the Sender ID itself. It can happen that if you stop using this solution you may need to generate a new Sender ID. If it's the case, Importing your Token base is useless because these won't be valid once users update their apps and there will be no possible matching with the Accengage device profiles.

2- Push notifications display

On Android, it is the app itself that manages the push notification display. This is why each solution will use its own parameter in the push notification payload that will be handled by the app and manage the push notification on the user device.

If you create and send push notifications from the Accengage dashboard, this is the Accengage payload that will be sent on the device. It will automatically manage the push display for the apps that have been updated with our SDK, but for the other devices you will need to ensure that the previous notification handler will also understand and read the payload.

Depending on how your push notifications were managed previously, it may be possible to attach Custom parameters that would reflect the expected push parameters of your previous provider. This would ensure the display of the notification for all your app owners.

In order to check this compatibility, please request the full push notification payload of your previous solution and send it to us. Note that it can also be tracked using the Android Studio logs. Once you have the payload, you can send it to your Accengage contact or our technical support and we will get back to with our feedback.

I do not receive push notifications. What could be the causes?

If you do not receive push notifications or if the sending summary show 0 push sent, it is important to verify several points which can help you to understand and solve quickly the point on your side.

1. Ensure that your segment has an up-to-date device ID

Regarding the segment, it is possible that the added criteria have not been saved. In this case, the segment is empty because it doesn't contain criteria. Using it as a sending target is comparative as sending the push to 0 user. When you create a segment, it is necessary to click first on "add criterion" and then "save segment".

If your segment is properly completed, you need to verify that it include your correct IDFV.

You can check this by looking at the last open date (see below). If it is not the right one, you have to update your device ID.

This is how you can recover your device ID:
Android : How to recover your device ID?

2. Check that you have valid device profile in your segment and which is the one linked to a token and have a feedback counter lower than 3. The current system optin status is also visible in the 'system optin notif' field.

Check your profile on the Accengage platform via Test Tools

3. Check the uploaded GCM/FCM Key in the platform.

The key has to be set up as "server key" and should have no IP filters.

Here is our guide to check your Google API Key.

4. Check your connection and test with several wifi networks and in 3G/4G. We also notice that some Corporate Wifi have restrictions that can affect the push reception.

5. Check your sending summary

You can check that our service has successfully sent the message to Google's servers directly from the message (see below).

If the sending summary is equal to zero, please check points 1 and 2 (device ID & Token).
If the sending summary is not equal to zero, the message has been successfully sent. Please check point 4 and 5. If the certificate status is not rejected, it means that the key is not well set up or is not equal to the right sender ID.

6. Check the App credentials status

If it appears wrong or is missing credentials, please check your API Key & Sender Id.

7. Check the marketing pressure

If you send your final push notifications none of them are received, please check the marketing pressure.

In some cases, the quota for push notifications might have been reached, which would explain why you do not receive the push notification.

8. Check the push configuration

If you do not receive a push notification, check the configuration of your push message. Be careful to make sure, if you’re in the open application, to “show the notification”.

My push action does not work. What could be the causes?

On Android, it could happen that the push action does not work when you send a push either when the app is killed, or when the app is in the background or in the foreground.

In order to understand why it happens, it is necessary to first understand our SDK functioning when we receive a push.

In each Activity (view or app page), three methods are integrated and called:

- The startActivity (in the onResume) : Allows to handle the Activity intent with the notification params. - The setIntent (in the onNewIntent) : Allows to indicate to the SDK that a screen, which was already launched, is launched again through a notification. - The stopActivity (in the onPause) : Allows to indicate to the SDK that we leave the Activity (not used for the notification management).

  • Please find below the possible explanations if the push action does not work when the app is killed:

1. The SDK is not integrated into the SplashScreen.

In this case, please find the scenario which could happen:

- You send a push with a rich push (webview, browser or URL schemes),

- You click on the push,

- You arrive on the SplashScreen

- You arrive on the HomePage,

- No action is done, so you stay on the HomePage.

If there is no action, the SDK could be not integrated into the SplashScreen. For Android, it is necessary that for each Activity, the SDK is launched. If the SDK is not launched into the SplashScreen, the push information could not be handled by the SDK.

2. There is no lock on the SplashScreen.

In this case, please find the scenario which could happen:

- You send a push with a rich push (webview, browser or URL schemes),

- You click on the push,

- You arrive on the SplashScreen,

- You arrive on the HomePage,

- No action is done, so you stay on the HomePage.

- When you click on "Back", you arrive on the intended page.

In this specific case, this is what happens with the system and the SDK:

- The information are handled on the onResume: the action is well executed,

- The SplashScreen loading ends in the background and launches the action towards the HomePage.

As there is no lock on the SplashScreen, the HomePage is launched directly after the action. This is why, the HomePage is over the action page.

It is necessary that a lock is set up on the SplashScreen in order to trigger the action only when you arrive on the main page of the app.

3. The redirection towards the HomePage is executed too soon.

In this case, please find the scenario which could happen:

- You send a push with a rich push (webview, browser or URL schemes),

- You click on the push,

- You arrive on the SplashScreen,

- You arrive on the HomePage,

- No action is done, so you stay on the HomePage.

In this case, the explanation is simple:

- The redirection towards the HomePage is triggered on the onCreate method, thereby, the push information do not have time to be handled by the SDK (through the onResume StartActivity). In this case, the push information are lost.

This is why, no action is executed.

  • Please find below the possible explanations if the push action does not work when the app is in the background or in the foreground:

1. A push lock is activated on the actual page.

In this case, please find the scenario which could happen:

- You send a push with a rich push (webview, browser or URL schemes),

- You receive the push,

- You click on the push,

- No action is done, so you stay on the actual page.

If a push lock is activated on the actual page, it will block the push execution until we arrive on an unlocked page.

It is necessary to verify that no push lock is activated on the actual page.

2. The SDK is not integrated in the actual page.

In this case, please find the scenario which could happen:

- You send a push with a rich push (webview, browser or URL schemes),

- You receive the push,

- You click on the push,

- No action is done, so you stay on the actual page.

Like the action push when the app is killed, if the SDK is not integrated on an Activity, the push action will never be handled by our SDK because the information will be lost.

3. The SetIntent method is not integrated.

In this case, please find the scenario which could happen:

- You send a push with a rich push,

- You receive the push,

- You click on the push,

- No action is done, so you stay on the actual page.

What happens in this case, is that the SetIntent method is not integrated on the onNewIntent, thereby, the push information are not handled by our SDK.

This is why, the push is well received but the push action is not executed.

To avoid that, it is necessary to verify that the SetIntent method is well integrated on the onNewIntent.

Crash because of Kotlin dependencies

If you are facing this Exception, that means you haven't added yet the kotlin dependencies in your project.

java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics;
    at com.ad4screen.sdk.service.modules.d.d.<init>(SourceFile)
    at com.ad4screen.sdk.common.a.a.<init>(SourceFile:185)
    at com.ad4screen.sdk.common.a.a.a(SourceFile:288)
    at com.ad4screen.sdk.A4SService.b(SourceFile:346)
    at com.ad4screen.sdk.A4SService.k(SourceFile:51)
    at com.ad4screen.sdk.A4SService$6$1.run(SourceFile:610)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6119)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.ClassNotFoundException: Didn't find class "kotlin.jvm.internal.Intrinsics" on path: DexPathList[[zip file "/data/app/ulrich.ulrich.ulrich-1/base.apk"],nativeLibraryDirectories=[/data/app/ulrich.ulrich.ulrich-1/lib/x86, /system/lib, /vendor/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

To do so, we recommend you to proceed as below :

Add the SDK to your app

build.gradle (project)

buildscript {
    ext.kotlin_version = '1.2.30'

    // ...
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

build.gradle (app)

apply plugin: 'kotlin-android'
// ...

dependencies {
    // ...
    implementation 'com.ad4screen.sdk:A4SSDK:3.7.0'

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
}