私は通知をプッシュするためにonesignalを使用していますが正常に動作しますが、通知を受け取ったときに、Android - OneSignalコールバックメソッドは一度も実行されませんでした(notificationReceived - notificationOpened)
ここは私のコードですが、私はドキュメントに従っていますが、私は何も持っていません。問題はどこにありますか?
public class MyApplication extends Application {
static Context context;
@Override public void onCreate() {
super.onCreate();
context = getApplicationContext();
OneSignal.startInit(this)
.autoPromptLocation(true)
.setNotificationOpenedHandler(new ExampleNotificationOpenedHandler())
.setNotificationReceivedHandler(new ExampleNotificationReceivedHandler())
.init();
}
private class ExampleNotificationReceivedHandler implements OneSignal.NotificationReceivedHandler {
@Override
public void notificationReceived(OSNotification notification) {
Log.d("OneSignalExample", "notificationReceived!!!!!!");
}
}
private class ExampleNotificationOpenedHandler implements OneSignal.NotificationOpenedHandler {
@Override
public void notificationOpened(OSNotificationOpenResult openedResult) {
Log.d("OneSignalExample", "notificationOpened!!!!!!");
}
}
}
ありがとう、それは私を助けた(Y) – Safa