logo

Engagelab Channel Integration Guide

อัพเดทล่าสุด :2023-12-13

Obtain application information

Create an application in the console. After the application is created, an AppKey is automatically generated to identify the application. For more information, see application Settings .

Importing Libraries

  • Manual method
Import the mt-sdk-x.x.x.aar from the libs folder into the libs directory. Import th-xxx-x.x.x.aar under the libs package into the libs directory
              Import the mt-sdk-x.x.x.aar from the libs folder into the libs directory.
    Import th-xxx-x.x.x.aar under the libs package into the libs directory

        
โค้ดนี้โชว์เป็นหน้าต่างลอย
  • Automatic method
dependencies { // Required: Main package implementation 'com.engagelab:engagelab:4.3.9' // Here, we use version 4.3.9 as an example. // Optional: Google vendor implementation 'com.engagelab.plugin:google:4.3.9' // Here, we use version 4.3.9 as an example. // Optional: Honor vendor implementation 'com.engagelab.plugin:honor:4.3.9' // Here, we use version 4.3.9 as an example. implementation 'com.engagelab.plugin:honor_th_push:4.3.9' // Here, we use version 4.3.9 as an example. // Optional: Huawei vendor implementation 'com.engagelab.plugin:huawei:4.3.9' // Here, we use version 4.3.9 as an example. // Optional: Xiaomi vendor, Chinese version implementation 'com.engagelab.plugin:mi_global:4.3.9' // Here, we use version 4.3.9 as an example. // Optional: Meizu vendor implementation 'com.engagelab.plugin:meizu:4.3.9' // Here, we use version 4.3.9 as an example. // Optional: Oppo vendor implementation 'com.engagelab.plugin:oppo:4.3.9' // Here, we use version 4.3.9 as an example. implementation 'com.engagelab.plugin:oppo_th_push:4.3.9' // Here, we use version 4.3.9 as an example. // Optional: Vivo vendor implementation 'com.engagelab.plugin:vivo:4.3.9' // Here, we use version 4.3.9 as an example. //Optional: sound voice broadcast function implementation 'com.engagelab.plugin:oth_sound:4.3.9' // Take version 4.3.9 as an example here. }
          
dependencies {
  // Required: Main package
  implementation 'com.engagelab:engagelab:4.3.9' // Here, we use version 4.3.9 as an example.
  // Optional: Google vendor
  implementation 'com.engagelab.plugin:google:4.3.9' // Here, we use version 4.3.9 as an example.
  // Optional: Honor vendor
  implementation 'com.engagelab.plugin:honor:4.3.9' // Here, we use version 4.3.9 as an example.
  implementation 'com.engagelab.plugin:honor_th_push:4.3.9' // Here, we use version 4.3.9 as an example.
  // Optional: Huawei vendor
  implementation 'com.engagelab.plugin:huawei:4.3.9' // Here, we use version 4.3.9 as an example.
  // Optional: Xiaomi vendor, Chinese version
  implementation 'com.engagelab.plugin:mi_global:4.3.9' // Here, we use version 4.3.9 as an example.
  // Optional: Meizu vendor
  implementation 'com.engagelab.plugin:meizu:4.3.9' // Here, we use version 4.3.9 as an example.
  // Optional: Oppo vendor
  implementation 'com.engagelab.plugin:oppo:4.3.9' // Here, we use version 4.3.9 as an example.
  implementation 'com.engagelab.plugin:oppo_th_push:4.3.9' // Here, we use version 4.3.9 as an example.
  // Optional: Vivo vendor
  implementation 'com.engagelab.plugin:vivo:4.3.9' // Here, we use version 4.3.9 as an example.
  //Optional: sound voice broadcast function
  implementation 'com.engagelab.plugin:oth_sound:4.3.9' // Take version 4.3.9 as an example here.
}


        
โค้ดนี้โชว์เป็นหน้าต่างลอย

2. Configure build.gradle

plugins { id 'com.android.application' } android { ... defaultConfig { // App package name, should be the same as on the console applicationId "com.engagelab.app" ... manifestPlaceholders = [ // AppKey, should be the same as on the console; one-to-one relationship with packageName ENGAGELAB_PRIVATES_APPKEY : "YourAppKey", // Engagelab appChannel, used for channel statistics ENGAGELAB_PRIVATES_CHANNEL: "developer", // Engagelab process, the process where Engagelab SDK works; note: starts with ENGAGELAB_PRIVATES_PROCESS: ":remote", ] } } dependencies { implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs') }
          plugins {
    id 'com.android.application'
}

android {
    ...

    defaultConfig {
        // App package name, should be the same as on the console
        applicationId "com.engagelab.app"
        ...
                
        manifestPlaceholders = [
                // AppKey, should be the same as on the console; one-to-one relationship with packageName
                ENGAGELAB_PRIVATES_APPKEY : "YourAppKey",
                // Engagelab appChannel, used for channel statistics
                ENGAGELAB_PRIVATES_CHANNEL: "developer",
                // Engagelab process, the process where Engagelab SDK works; note: starts with
                ENGAGELAB_PRIVATES_PROCESS: ":remote",
                
        ]
    }
}

dependencies {
    implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
}

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

Create required components

package com.engagelab.app.component; import com.engagelab.privates.common.component.MTCommonService; /** * Developers can extend MTCommonService to prolong the longevity of the long connection. * * Empty implementation is sufficient. */ public class UserService extends MTCommonService { }
          package com.engagelab.app.component;

import com.engagelab.privates.common.component.MTCommonService;

/**
 * Developers can extend MTCommonService to prolong the longevity of the long connection.
 *
 * Empty implementation is sufficient.
 */
public class UserService extends MTCommonService {

}

        
โค้ดนี้โชว์เป็นหน้าต่างลอย
package com.engagelab.app.component; import android.content.Context; import android.widget.Toast; import java.util.Arrays; import com.engagelab.app.common.ExampleGlobal; import com.engagelab.app.listener.StatusObserver; import com.engagelab.app.log.ExampleLogger; import com.engagelab.privates.common.component.MTCommonReceiver; import com.engagelab.privates.core.api.MTCorePrivatesApi; import com.engagelab.privates.core.api.WakeMessage; import com.engagelab.privates.push.api.CustomMessage; import com.engagelab.privates.push.api.MobileNumberMessage; import com.engagelab.privates.push.api.NotificationMessage; import com.engagelab.privates.push.api.PlatformTokenMessage; /** * Developers can extend MTCommonReceiver to receive method callbacks from the SDK. * * All callbacks are in the main thread. */ public class UserReceiver extends MTCommonReceiver { private static final String TAG = "UserReceiver"; /** * Callback for the application notification switch status. * * @param context Not null * @param enable Notification switch status, true for on, false for off */ @Override public void onNotificationStatus(Context context, boolean enable) { ExampleLogger.i(TAG, "onNotificationStatus:" + enable); Toast.makeText(context.getApplicationContext(), "onNotificationStatus " + enable, Toast.LENGTH_SHORT).show(); ExampleGlobal.isNotificationEnable = enable; if (StatusObserver.getInstance().getListener() != null) { StatusObserver.getInstance().getListener().onNotificationStatus(enable); } } /** * Long connection status callback. * * @param context Not null * @param enable Whether the connection is established */ @Override public void onConnectStatus(Context context, boolean enable) { ExampleLogger.i(TAG, "onConnectState:" + enable); Toast.makeText(context.getApplicationContext(), "onConnectStatus " + enable, Toast.LENGTH_SHORT).show(); ExampleGlobal.isConnectEnable = enable; if (StatusObserver.getInstance().getListener() != null) { StatusObserver.getInstance().getListener().onConnectStatus(enable); } // Get the registrationId when the long connection is established if (enable) { String registrationId = MTCorePrivatesApi.getRegistrationId(context); ExampleLogger.i(TAG, "registrationId:" + registrationId); } } /** * Callback for notification message arrival. * * @param context Not null * @param notificationMessage Notification message */ @Override public void onNotificationArrived(Context context, NotificationMessage notificationMessage) { ExampleLogger.i(TAG, "onNotificationArrived:" + notificationMessage.toString()); } /** * Callback for notification messages not displayed in the foreground. * * @param context Not null * @param notificationMessage Notification message */ @Override public void onNotificationUnShow(Context context, NotificationMessage notificationMessage) { ExampleLogger.i(TAG, "onNotificationUnShow:" + notificationMessage.toString()); } /** * Callback for notification message click. * * @param context Not null * @param notificationMessage Notification message */ @Override public void onNotificationClicked(Context context, NotificationMessage notificationMessage) { ExampleLogger.i(TAG, "onNotificationClicked:" + notificationMessage.toString()); } /** * Callback for notification message deletion. * * @param context Not null * @param notificationMessage Notification message */ @Override public void onNotificationDeleted(Context context, NotificationMessage notificationMessage) { ExampleLogger.i(TAG, "onNotificationDeleted:" + notificationMessage.toString()); } /** * Custom message callback. * * @param context Not null * @param customMessage Custom message */ @Override public void onCustomMessage(Context context, CustomMessage customMessage) { ExampleLogger.i(TAG, "onCustomMessage:" + customMessage.toString()); } /** * Vendor token message callback. * * @param context Not null * @param platformTokenMessage Vendor token message */ @Override public void onPlatformToken(Context context, PlatformTokenMessage platformTokenMessage) { ExampleLogger.i(TAG, "onPlatformToken:" + platformTokenMessage.toString()); } }
          package com.engagelab.app.component;

import android.content.Context;
import android.widget.Toast;

import java.util.Arrays;

import com.engagelab.app.common.ExampleGlobal;
import com.engagelab.app.listener.StatusObserver;
import com.engagelab.app.log.ExampleLogger;
import com.engagelab.privates.common.component.MTCommonReceiver;
import com.engagelab.privates.core.api.MTCorePrivatesApi;
import com.engagelab.privates.core.api.WakeMessage;
import com.engagelab.privates.push.api.CustomMessage;
import com.engagelab.privates.push.api.MobileNumberMessage;
import com.engagelab.privates.push.api.NotificationMessage;
import com.engagelab.privates.push.api.PlatformTokenMessage;

/**
 * Developers can extend MTCommonReceiver to receive method callbacks from the SDK.
 *
 * All callbacks are in the main thread.
 */
public class UserReceiver extends MTCommonReceiver {

    private static final String TAG = "UserReceiver";

    /**
     * Callback for the application notification switch status.
     *
     * @param context Not null
     * @param enable Notification switch status, true for on, false for off
     */
    @Override
    public void onNotificationStatus(Context context, boolean enable) {
        ExampleLogger.i(TAG, "onNotificationStatus:" + enable);
        Toast.makeText(context.getApplicationContext(), "onNotificationStatus " + enable, Toast.LENGTH_SHORT).show();
        ExampleGlobal.isNotificationEnable = enable;
        if (StatusObserver.getInstance().getListener() != null) {
            StatusObserver.getInstance().getListener().onNotificationStatus(enable);
        }
    }

    /**
     * Long connection status callback.
     *
     * @param context Not null
     * @param enable Whether the connection is established
     */
    @Override
    public void onConnectStatus(Context context, boolean enable) {
        ExampleLogger.i(TAG, "onConnectState:" + enable);
        Toast.makeText(context.getApplicationContext(), "onConnectStatus " + enable, Toast.LENGTH_SHORT).show();
        ExampleGlobal.isConnectEnable = enable;
        if (StatusObserver.getInstance().getListener() != null) {
            StatusObserver.getInstance().getListener().onConnectStatus(enable);
        }
        // Get the registrationId when the long connection is established
        if (enable) {
            String registrationId = MTCorePrivatesApi.getRegistrationId(context);
            ExampleLogger.i(TAG, "registrationId:" + registrationId);
        }
    }

    /**
     * Callback for notification message arrival.
     *
     * @param context Not null
     * @param notificationMessage Notification message
     */
    @Override
    public void onNotificationArrived(Context context, NotificationMessage notificationMessage) {
        ExampleLogger.i(TAG, "onNotificationArrived:" + notificationMessage.toString());
    }

    /**
     * Callback for notification messages not displayed in the foreground.
     *
     * @param context Not null
     * @param notificationMessage Notification message
     */
    @Override
    public void onNotificationUnShow(Context context, NotificationMessage notificationMessage) {
        ExampleLogger.i(TAG, "onNotificationUnShow:" + notificationMessage.toString());
    }

    /**
     * Callback for notification message click.
     *
     * @param context Not null
     * @param notificationMessage Notification message
     */
    @Override
    public void onNotificationClicked(Context context, NotificationMessage notificationMessage) {
        ExampleLogger.i(TAG, "onNotificationClicked:" + notificationMessage.toString());
    }

    /**
     * Callback for notification message deletion.
     *
     * @param context Not null
     * @param notificationMessage Notification message
     */
    @Override
    public void onNotificationDeleted(Context context, NotificationMessage notificationMessage) {
        ExampleLogger.i(TAG, "onNotificationDeleted:" + notificationMessage.toString());
    }

    /**
     * Custom message callback.
     *
     * @param context Not null
     * @param customMessage Custom message
     */
    @Override
    public void onCustomMessage(Context context, CustomMessage customMessage) {
        ExampleLogger.i(TAG, "onCustomMessage:" + customMessage.toString());
    }

    /**
     * Vendor token message callback.
     *
     * @param context Not null
     * @param platformTokenMessage Vendor token message
     */
    @Override
    public void onPlatformToken(Context context, PlatformTokenMessage platformTokenMessage) {
        ExampleLogger.i(TAG, "onPlatformToken:" + platformTokenMessage.toString());
    }

}

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

4. Configure AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.engagelab.app"> <!-- Required: Internet permission --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- Optional: Vibration for notifications --> <uses-permission android:name="android.permission.VIBRATE" /> <application android:name="com.engagelab.app.MainApplication" android:allowBackup="false" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/Theme.MT" android:usesCleartextTraffic="true" tools:targetApi="m"> <!-- If using HTTP requests, allow HTTP --> ..................................................................................................... <!-- Due to the long connection feature of this class, the power-saving optimization by the manufacturer may directly kill the service with a package name containing "Engagelab" in the name. --> <!-- Therefore, developers need to extend com.engagelab.app.component.MTCommonService to improve the long connection survival rate and increase the message arrival rate. --> <service android:name="com.engagelab.app.component.UserService" android:exported="false" android:process="${ENGAGELAB_PRIVATES_PROCESS}"> <intent-filter> <action android:name="com.engagelab.privates.intent.USER_SERVICE" /> </intent-filter> </service> <!-- Used to receive Engagelab business callbacks, including long connection status/notification switch status/notification message arrival/notification message click/notification message deletion/custom message/vendor token callback --> <!-- No need to configure sub-processes; this callback is in the main process for ease of business operations --> <receiver android:name="com.engagelab.app.component.UserReceiver" android:exported="false"> <intent-filter> <action android:name="com.engagelab.privates.intent.USER_RECEIVER" /> </intent-filter> </receiver> </application> </manifest>
          <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.engagelab.app">
        
    <!-- Required: Internet permission -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <!-- Optional: Vibration for notifications -->
    <uses-permission android:name="android.permission.VIBRATE" /> 
        
    <application
        android:name="com.engagelab.app.MainApplication"
        android:allowBackup="false"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/Theme.MT"
        android:usesCleartextTraffic="true"
        tools:targetApi="m"> <!-- If using HTTP requests, allow HTTP -->

                .....................................................................................................
                
        <!-- Due to the long connection feature of this class, the power-saving optimization by the manufacturer may directly kill the service with a package name containing "Engagelab" in the name. -->
        <!-- Therefore, developers need to extend com.engagelab.app.component.MTCommonService to improve the long connection survival rate and increase the message arrival rate. -->
        <service
            android:name="com.engagelab.app.component.UserService"
            android:exported="false"
            android:process="${ENGAGELAB_PRIVATES_PROCESS}">
            <intent-filter>
                <action android:name="com.engagelab.privates.intent.USER_SERVICE" />
            </intent-filter>
        </service>

        <!-- Used to receive Engagelab business callbacks, including long connection status/notification switch status/notification message arrival/notification message click/notification message deletion/custom message/vendor token callback -->
        <!-- No need to configure sub-processes; this callback is in the main process for ease of business operations -->
        <receiver
            android:name="com.engagelab.app.component.UserReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="com.engagelab.privates.intent.USER_RECEIVER" />
            </intent-filter>
        </receiver>

    </application>

</manifest>


        
โค้ดนี้โชว์เป็นหน้าต่างลอย

5. Environment Configuration

package com.engagelab.app; import android.app.Application; import com.engagelab.privates.core.api.Address; import com.engagelab.privates.core.api.MTCorePrivatesApi; import com.engagelab.privates.push.api.MTPushPrivatesApi; /** * Used to demonstrate the configuration of the ENGAGELAB-sdk. */ public class MainApplication extends Application { private static final String TAG = "MainApplication"; @Override public void onCreate() { super.onCreate(); // Configuration must be done in application.onCreate, no need to check processes, the SDK has an internal check. MTCorePrivatesApi.configDebugMode(this, true); // For versions before tag: V3.5.4-newportal-20210823-gamma.57, this method must be called by the frontend developers; otherwise, there will be issues with notification click jump. // MTPushPrivatesApi.configOldPushVersion(context.getApplicationContext()); // Initialize push // MTPushPrivatesApi.init(this); } }
          package com.engagelab.app;

import android.app.Application;

import com.engagelab.privates.core.api.Address;
import com.engagelab.privates.core.api.MTCorePrivatesApi;
import com.engagelab.privates.push.api.MTPushPrivatesApi;

/**
 * Used to demonstrate the configuration of the ENGAGELAB-sdk.
 */
public class MainApplication extends Application {

    private static final String TAG = "MainApplication";

    @Override
    public void onCreate() {
        super.onCreate();


        // Configuration must be done in application.onCreate, no need to check processes, the SDK has an internal check.
        MTCorePrivatesApi.configDebugMode(this, true);

        // For versions before tag: V3.5.4-newportal-20210823-gamma.57, this method must be called by the frontend developers; otherwise, there will be issues with notification click jump.
        // MTPushPrivatesApi.configOldPushVersion(context.getApplicationContext());

        // Initialize push
        // MTPushPrivatesApi.init(this);
    }

}

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

6. Create a Notification Click Jump Component

package com.engagelab.app.component; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.widget.TextView; import android.widget.Toast; import com.engagelab.app.R; import com.engagelab.app.log.ExampleLogger; import com.engagelab.privates.push.api.MTPushPrivatesApi; import com.engagelab.privates.push.api.NotificationMessage; import com.engagelab.privates.push.constants.MTPushConstants; /** * Used to demonstrate clicking on a notification to jump to an activity. * * Make sure that MTPushPrivatesApi.configOldPushVersion(Context) is not called, otherwise the notification click jump will not go to this page. * <p> * No need to call MTPushPrivatesApi.reportNotificationOpened(Context, String, byte, String); the SDK handles it internally. */ public class UserActivity400 extends Activity { private static final String TAG = "UserActivity400"; private TextView tvMessage; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_intent); tvMessage = findViewById(R.id.tv_message); onIntent(getIntent()); } @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); onIntent(intent); } private void onIntent(Intent intent) { try { Toast.makeText(this, TAG, Toast.LENGTH_SHORT).show(); if (intent == null) { return; } // Starting from version 3.4.0, objects are no longer used; JSON data is used instead String notificationMessage = intent.getStringExtra("message_json"); if (notificationMessage == null) { return; } ExampleLogger.d(TAG, "notificationMessage:" + notificationMessage.toString()); tvMessage.setText(notificationMessage.toString()); } catch (Throwable throwable) { throwable.printStackTrace(); } } }
          package com.engagelab.app.component;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

import com.engagelab.app.R;
import com.engagelab.app.log.ExampleLogger;
import com.engagelab.privates.push.api.MTPushPrivatesApi;
import com.engagelab.privates.push.api.NotificationMessage;
import com.engagelab.privates.push.constants.MTPushConstants;

/**
 * Used to demonstrate clicking on a notification to jump to an activity.
 *
 * Make sure that MTPushPrivatesApi.configOldPushVersion(Context) is not called, otherwise the notification click jump will not go to this page.
 * <p>
 * No need to call MTPushPrivatesApi.reportNotificationOpened(Context, String, byte, String); the SDK handles it internally.
 */
public class UserActivity400 extends Activity {

    private static final String TAG = "UserActivity400";

    private TextView tvMessage;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_intent);
        tvMessage = findViewById(R.id.tv_message);
        onIntent(getIntent());
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        onIntent(intent);
    }

    private void onIntent(Intent intent) {
        try {
            Toast.makeText(this, TAG, Toast.LENGTH_SHORT).show();
            if (intent == null) {
                return;
            }
            // Starting from version 3.4.0, objects are no longer used; JSON data is used instead
            String notificationMessage = intent.getStringExtra("message_json");
            if (notificationMessage == null) {
                return;
            }
            ExampleLogger.d(TAG, "notificationMessage:" + notificationMessage.toString());
            tvMessage.setText(notificationMessage.toString());
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
    }
        
}

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

7. Configure the AndroidManifest.xml for Click Jump

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.engagelab.app"> <!-- Required: Internet permission --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- Optional: Vibration for notifications --> <uses-permission android:name="android.permission.VIBRATE" /> <application android:name="com.engagelab.app.MainApplication" android:allowBackup="false" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/Theme.MT" android:usesCleartextTraffic="true" tools:targetApi="m"> <!-- If using HTTP requests, allow HTTP --> .............................................................. <!-- Used to demonstrate notification click jump --> <activity android:name="com.engagelab.app.component.UserActivity400" android:exported="false" android:launchMode="singleTask" /> <!-- Used to demonstrate notification click jump with deep links --> <!-- <activity--> <!-- android:name="com.engagelab.app.component.UserActivity400"--> <!-- android:exported="false" >--> <!-- <intent-filter>--> <!-- <data android:scheme="YourScheme"/>--> <!-- <data android:host="YourHost"/>--> <!-- <action android:name="android.intent.action.VIEW" />--> <!-- <category android:name="android.intent.category.DEFAULT" />--> <!-- <category android:name="android.intent.category.BROWSABLE" />--> <!-- </intent-filter>--> <!-- </activity>--> <!-- White-listed local transfer verification: Starting from MTPush 4.2.3, after configuring ENGAGELAB_PRIVATES_TRANSFER, the SDK will perform local verification. If local verification is enabled, please configure the target Activity to be jumped to here. If there are multiple target Activities, please separate them with /. --> <meta-data android:name="ENGAGELAB_PRIVATES_TRANSFER" android:value="com.engagelab.app.component.UserActivity400" /> <!-- Google push need: Remove if Google channel is not needed --> <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/mtpush_notification_icon" /> <!-- Huawei push need: Remove if Huawei channel is not needed --> <meta-data android:name="com.huawei.messaging.default_notification_icon" android:resource="@drawable/mtpush_notification_icon" /> </application> </manifest>
          <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.engagelab.app">

    <!-- Required: Internet permission -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <!-- Optional: Vibration for notifications -->
    <uses-permission android:name="android.permission.VIBRATE" />

    <application
        android:name="com.engagelab.app.MainApplication"
        android:allowBackup="false"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/Theme.MT"
        android:usesCleartextTraffic="true"
        tools:targetApi="m"> <!-- If using HTTP requests, allow HTTP -->

        ..............................................................

        <!-- Used to demonstrate notification click jump -->
        <activity
            android:name="com.engagelab.app.component.UserActivity400"
            android:exported="false"
            android:launchMode="singleTask" />

        <!-- Used to demonstrate notification click jump with deep links -->
<!--        <activity-->
<!--            android:name="com.engagelab.app.component.UserActivity400"-->
<!--            android:exported="false" >-->
<!--            <intent-filter>-->
<!--                <data android:scheme="YourScheme"/>-->
<!--                <data android:host="YourHost"/>-->
<!--                <action android:name="android.intent.action.VIEW" />-->
<!--                <category android:name="android.intent.category.DEFAULT" />-->
<!--                <category android:name="android.intent.category.BROWSABLE" />-->
<!--            </intent-filter>-->
<!--        </activity>-->

            
        <!-- White-listed local transfer verification: Starting from MTPush 4.2.3, after configuring ENGAGELAB_PRIVATES_TRANSFER, the SDK will perform local verification. If local verification is enabled, please configure the target Activity to be jumped to here. If there are multiple target Activities, please separate them with /. -->
        <meta-data
            android:name="ENGAGELAB_PRIVATES_TRANSFER"
            android:value="com.engagelab.app.component.UserActivity400" />
                
        <!-- Google push need: Remove if Google channel is not needed -->
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/mtpush_notification_icon" />

        <!-- Huawei push need: Remove if Huawei channel is not needed -->
        <meta-data
            android:name="com.huawei.messaging.default_notification_icon"
            android:resource="@drawable/mtpush_notification_icon" />

    </application>

</manifest>

        
โค้ดนี้โชว์เป็นหน้าต่างลอย
在文档中心打开
icon
ติดต่อฝ่ายขาย