您將不得不在Android中的Manifest文件中添加此行。在其中一個應用程序中,我也實現了此One信號。
<receiver android:name="com.onesignal.UpgradeReceiver">
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>
除此之外,你還應該添加在Android清單文件,該行。
<meta-data
android:name="onesignal_app_id"
android:value="yyyyssyshsbchdsdavbavbfjvbkfdj" />
<meta-data
android:name="onesignal_google_project_number"
android:value="xxxxxxxxx" />
<receiver
android:name="com.onesignal.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.newsreader.sitl" />
</intent-filter>
</receiver>
<receiver android:name="com.onesignal.NotificationOpenedReceiver" />
<service android:name="com.onesignal.GcmIntentService" />
<service
android:name="com.onesignal.SyncService"
android:stopWithTask="false" />
<activity
android:name="com.onesignal.PermissionsActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<service android:name="com.onesignal.NotificationRestoreService" />
<receiver android:name="com.onesignal.BootUpReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
</intent-filter>
</receiver
>
<service
android:name="com.newsreader.notificationHelper.NotificationExtender"
android:exported="false">
<intent-filter>
<action android:name="com.onesignal.NotificationExtender" />
</intent-filter>
</service>
<meta-data android:name="com.onesignal.NotificationOpened.DEFAULT" android:value="DISABLE" />
您是否在Android清單文件中定義了此類? – Rims
你使用什麼編程語言? – Hristo
@Rims否,在文檔中它沒有這麼說要在清單中做任何事情 – jash