Documentation
Search
⌃K

Deeplinks

Scheme

Internal scheme

apm:// is the internal scheme of the SDK APM
For example: a button in a interstitial opening the screen challenges apm://screen_challenge
You can use these internal scheme from :
  • webView inApp (onboarding, walkthrough, campaign)
  • button deeplink from a generosity
  • button deeplink from a game
  • button deeplink from a challenge

External direct scheme

apm<PARTNER_ID> is the external scheme of the SDK APM
For example: a push notification opening the screen challenges apm0123456789://screen_challenges
For use this external direct deeplink, you must configure the application with this new scheme.
iOS
Android
In file Info.plist, add the scheme apm<PARTNER_ID>, PARTNER_ID is the ID transmitted during the implementation of the project
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<!-- Add this scheme -->
<string>apm<PARTNER_ID></string> <!-- Example : apm0123456789 -->
</array>
</dict>
</array>
Retrieve the deeplink in AppDelegate
-(BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation {
//Get the deeplink from "url"
}
And, you can execute the deeplink in the HomeViewController of your app
//Check if deeplink is a valid APM deeplink
if([APMWKUtils schemeApmValidForUrl:url.absoluteString]) {
//Launch the deeplink
[APMWebViewUtils handleUrl:[NSURLRequest requestWithURL:deeplink] controller:self];
}
If needed, you can use dispatch_after to launch the deeplink after some delay
//Check if deeplink is a valid APM deeplink
if([APMWKUtils schemeApmValidForUrl:url.absoluteString]) {
//Launch the deeplink after 500ms
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5f * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[APMWebViewUtils handleUrl:[NSURLRequest requestWithURL:deeplink] controller:self];
});
}
In file AndroidManifest.xml, add the scheme apm<PARTNER_ID>, PARTNER_ID is the ID transmitted during the implementation of the project
<activity
android:name=".SplashActivity"
<!-- ... -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.APP_BROWSER" />
<!-- Add this scheme -->
<data android:scheme="apm<PARTNER_ID>" /> <!-- Example : apm0123456789 -->
</intent-filter>
</activity>
Retrieve the deeplink in SplashActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//...
String deepLink = Utils.getDeeplinkFromIntent(getIntent());
}
Class Utils
//Global method for get deeplink
public static String getDeeplinkFromIntent(Intent intent) {
//Deeplink from batch
String deepLink = BatchUtils.deepLinkFromIntent(intent);
//Default deeplink
if(deepLink == null && intent.getData() != null)
deepLink = intent.getData().toString();
return deepLink;
}
//Method util to get deeplink from a push notification from Batch
private static String deepLinkFromIntent(Intent intent) {
String deepLink = null;
if(intent != null && intent.getExtras() != null) {
try {
BatchPushPayload pushData = BatchPushPayload.payloadFromBundle(intent.getExtras());
if(pushData.hasDeeplink())
deepLink = pushData.getDeeplink();
}
catch(Exception e) {
e.printStackTrace();
}
}
return deepLink;
}
And, you can execute the deeplink in the HomeActivity of your app
//Check if deeplink is a valid APM deeplink
if(APMWKUtils.schemeApmValidForUrl(deepLink)) {
//Launch the deeplink
APMWebViewUtils.handleUrl(deepLink);
}
If needed, you can use a Handler object to launch the deeplink after some delay
//Check if deeplink is a valid APM deeplink
if(APMWKUtils.schemeApmValidForUrl(deepLink)) {
//Launch the deeplink after 500ms
final String finalDeepLink = deepLink;
handler.postDelayed(new Runnable() {
@Override
public void run() {
APMWebViewUtils.handleUrl(finalDeepLink);
}
}, 500);
}
You can use these external scheme for
  • push notification
  • email link
  • etc

External indirect scheme

If you use your scheme url to send a deeplink to your app. You can passe a sub deeplink.
For example: a push notification opening the screen challenges your_scheme://apm0123456789://screen_challenges
You can extract the sub deeplink and execute this as a External direct deeplink
Ces deeplinks sont compatibles avec :
  • Ecran Daily Challenge : clic sur le bouton "j'y vais"
  • Ecran Challenges : clic sur un challenge
  • Ecran Game : clic sur le bouton en bas de page
  • triggerAction : trigger de type page
  • WebView SDK (onboarding, walkthrough, tuto...)

Screen (big badge)

apm://screen_challenges Ouverture de l'écran challenge
apm://screen_trophies Ouverture de l'écran trophées
apm://screen_daily_challenge Ouverture de l'écran challenge du jour
apm://screen_how_works Ouverture de l'écran comment ça marche
apm://screen_barcode Ouverture de l'écran code-barre
apm://screen_burns Ouverture de l'écran historique de cadeau
apm://screen_burn/<BURN_ID> Ouverture de l'écran mon cadeau (déjà converti), BURN_ID est obligatoire
apm://screen_earns Ouverture de l'écran historique des gains
apm://screen_gifts Ouverture de l'écran catalogue cadeaux
apm://screen_gift/<GIFT_ID> Ouverture de l'écran mon cadeau (non converti), GIFT_ID est obligatoire
apm://screen_infos Ouverture de l'écran infos
apm://screen_my_account Ouverture de l'écran mon compte
apm://screen_unsubscribe Ouverture de l'écran se désinscrire
apm://screen_levels Ouverture de l'écran niveaux
apm://trigger_game/<GAME_ID> Ouverture d'un jeu, GAME_ID est obligatoire

Page (big badge or fullscreen)

apm://screen_page/<PAGE_ID> Ouverture de l'écran page webview, PAGE_ID est obligatoire
On peut ajouter l'option display : - bigbadge : qui permet d'afficher de la page en mode big badge - interstitial : qui permet d'afficher le page en mode fullscreen
apm://screen_page/10?display=bigbadge apm://screen_page/10?display=interstitial
apm://screen_pages/<RUBRIC_ID> Ouverture de l'écran page webview avec un slider selon le nombre de page configuré, RUBRIC_ID est obligatoire (v5.6.1)

Onboarding (fullscreen)

apm://onboarding_connected Ouverture de l'onboarding connecté
apm://onboarding_not_connected Ouverture de l'onboarding non connecté

TriggerAction

apm://trigger_action/<TAG_ID> Lance un triggerAction, TAG_ID est obligatoire
apm://trigger_action_back/ACTION_NAME Lance un triggerAction puis fait un back en mode big badge, TAG_ID est obligatoire
Ces deeplinks ne sont plus utilisées mais ils existent

Pages WebView (old)

apm://page/<PAGE_CONSTANT_ID> Ouverture de l'écran page webView, PAGE_CONSTANT_ID est obligatoire
//PAGE_CONSTANT_ID
public static final int APM_SHOW_PAGE_CNIL = 1;
public static final int APM_SHOW_PAGE_CGU = 2;
public static final int APM_SHOW_PAGE_MENTIONS = 3;
public static final int APM_SHOW_PAGE_HELPER = 4;
public static final int APM_SHOW_PAGE_APP_ONBOARDING = 7;
public static final int APM_SHOW_PAGE_APP_MENTION = 8;
public static final int APM_SHOW_PAGE_APP_TUTORIAL = 9;
apm://screen_cnil Ouverture de l'écran page webView CNIL
apm://screen_cgu Ouverture de l'écran page webView CGU
apm://screen_mentions Ouverture de l'écran page webView MENTIONS
apm://screen_helper Ouverture de l'écran page webView HELPER
apm://screen_app_onboarding Ouverture de l'écran page webView ONBOARDING
apm://screen_app_mention Ouverture de l'écran page webView APP_ONBOARDING
apm://screen_app_tutorial Ouverture de l'écran page webView TUTORIAL
Ces deeplinks sont compatibles avec :
  • WebView SDK (onboarding, walkthrough, tuto...)

Général

apm://closeBadge Permet de fermer le big badge ou l'écran fullscreen
apm://back Permet de faire un back en mode big badge

Onboarding seulement

apm://onboarding/ok Clic sur le bouton Accepter d'un écran onboarding
apm://onboarding/later Clic sur le bouton Accepter d'un écran onboarding
apm://onboarding/never Clic sur le bouton Accepter d'un écran onboarding