Android
Hướng dẫn tích hợp mobile push cho Android app.
Điều kiện:
1. Nếu bạn chưa có tài khoản, hãy đăng ký tại pushdy.com

2. Thiết lập Mobile Push cho ứng dụng của bạn


3. Cài đặt SDK cho Android app
Last updated
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}dependencies {
implementation 'com.github.Pushdy:android-pushdy-sdk:0.0.3'
}<application>
...
<service
android:name="com.pushdy.services.PDYFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>npm install react-native-pushdy --saveimport com.pushdy.Pushdy;import com.pushdy.Pushdyimport com.reactNativePushdy.PushdySdk;public class YourApplication extends Application
implements Pushdy.PushdyDelegate {
@Override
public void onCreate() {
super.onCreate();
String clientKey = "YOUR_CLIENT_KEY";
Pushdy.initWith(this, clientKey, this, R.drawable.ic_launcher_small);
}
}class YourApplication : Application(), Pushdy.PushdyDelegate {
override fun onCreate() {
super.onCreate()
val clientKey = "YOUR_CLIENT_KEY"
Pushdy.initWith(this, clientKey, this, R.drawable.ic_launcher_small)
}
}public class YourApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
String clientKey = "YOUR_CLIENT_KEY";
PushdySdk.getInstance().registerSdk(clientKey,
this, R.mipmap.ic_notification);
}
}@Override
public void onNewIntent(Intent intent) {
setIntent(intent);
super.onNewIntent(intent);
}await Pushdy.initPushdy({
deviceId: 'YOUR DEVICE ID'
});