AndroidManifest.xml文件的onesignal4中com.onesignal.GcmBroadcastReceiver的等效项

34gzjxbg  于 2023-05-27  发布在  Android
关注(0)|答案(1)|浏览(129)

我尝试从'com.onesignal:OneSignal:3.12.2'升级到'com.onesignal:OneSignal:[4.0.0, 4.99.99]',但在com.onesignal:OneSignal:[4.0.0, 4.99.99]的文档中找不到com.onesignal.GcmBroadcastReceiver的等效版本
以下是我用于升级的文档:https://documentation.onesignal.com/docs/android-13-push-notification-developer-update-guide
下面的代码是来自com.onesignal:OneSignal:3.12.2AndroidManifest.xml文件的一段代码,我想将其替换为com.onesignal:OneSignal:[4.0.0, 4.99.99]的等效代码

<receiver
        android:name="com.onesignal.GcmBroadcastReceiver"
        android:exported="true"
        android:permission="com.google.android.c2dm.permission.SEND">

            <!-- High priority so OneSignal payloads can be filtered from other GCM receivers if filterOtherGCMReceivers is enabled. -->
            <intent-filter android:priority="999">
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />

                <category android:name="${applicationId}" />
            </intent-filter>
        </receiver>
31moq8wy

31moq8wy1#

com.onesignal.GcmBroadcastReceiver在OneSignal SDK的4.0.0版本中被com.onesignal.FCMBroadcastReceiver取代。
FCMBroadcastReceiver只是OneSignal-Android-SDK的实现细节,没有必要将其添加到您自己的AndroidManifest.xml中,因为SDK已经为您提供了它:https://github.com/OneSignal/OneSignal-Android-SDK/blob/4.8.6/OneSignalSDK/onesignal/src/release/AndroidManifest.xml#L10-L19

相关问题