将UrbanAirship Library从8.3.2升级到9.0.0

问题描述 投票:0回答:1

推送通知对我来说无法正常工作,因为我使用的是旧的Urban Airship(现在简称为Airship)。我使用的是8.3版,我需要升级到9.0.0版。我正在阅读https://github.com/urbanairship/android-library/blob/master/documentation/migration/migration-guide.md有关如何升级的说明。我发现这部分与我的案例有关:

UrbanAirship Library 8.x至9.0.0

GCM

所有GCM类都已移至com.urbanairship.push.gcm包中。如果您已在清单中手动添加了GcmPushReceiverUAInstanceIDListenerService,请更新条目。

我在源代码中找到了两个AndroidManifest.xml文件:

  1. C:\用户[路径] \应用\ SRC \主\的AndroidManifest.xml <!-- Optional: Receives push and registration events from the Urban Airship SDK. --> <intent-filter> <action android:name="com.urbanairship.push.CHANNEL_UPDATED"/> <action android:name="com.urbanairship.push.OPENED"/> <action android:name="com.urbanairship.push.DISMISSED"/> <action android:name="com.urbanairship.push.RECEIVED"/> <category android:name="${applicationId}"/> </intent-filter>
  2. C:\用户[路径] \应用\建立\中间体\分解-AAR \ com.urbanairship.android \ urbanairship-SDK \ 8.3.2 \的AndroidManifest.xml

``

    <service
        android:name="com.urbanairship.push.UAInstanceIDListenerService"
        android:exported="false" >
        <intent-filter android:priority="-999" >
            <action android:name="com.google.android.gms.iid.InstanceID" />
        </intent-filter>
    </service>

    <receiver
        android:name="com.urbanairship.push.GcmPushReceiver"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter android:priority="-999" >
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

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

问题1.当指令要求更新条目in your manifest时,是否指的是我上面列出的第一个或第二个AndroidManifest.xml文件?我认为它只能引用C:\Users[path]\app\src\main\AndroidManifest.xml,因为编译应用程序时会自动生成C:\Users\[path]\app\build\intermediates\exploded-aar\com.urbanairship.android\urbanairship-sdk\8.3.2\AndroidManifest.xml

问题2.当说明说in your manifest, please update the entries时,是否意味着删除手动添加的行,因为包com.urbanairship.push.gcm已经包含GcmPushReceiverUAInstanceIDListenerService并且它会自动处理它?

谢谢。

更新1:查看https://github.com/urbanairship/android-library/blob/master/urbanairship-gcm/src/main/AndroidManifest.xml上的Android.Manifest.xml文件,一旦升级到V9.7.1,我的应该是这样的,对吗?然后我应该在我的项目中包含https://github.com/urbanairship/android-library/tree/master/urbanairship-gcm/src/main/java/com/urbanairship/push/gcm中列出的文件/类。正确?

android push-notification android-manifest urbanairship.com android-push-notification
1个回答
0
投票

现在我在我的build.gradle (Module: app)中使用它:

// Urban Airship SDK
//compile 'com.urbanairship.android:urbanairship-sdk:8.3.+'
implementation 'com.urbanairship.android:urbanairship-fcm:9.7.1'

我还必须做以下事情,以摆脱我最初在使用implementation 'com.urbanairship.android:urbanairship-fcm:9.7.1'时看到的一些错误:

  1. 安装`Android SDK Platform 28(平台; android-28)
  2. 用`build.gradle(模块:app)替换compileSdkVersion 23compileSdkVersion 28

enter image description here enter image description here

我也使用File > Invalidate Caches / Restart...以防万一,以确保修改build.gradle (Module: app)文件后所有内容都刷新。

© www.soinside.com 2019 - 2024. All rights reserved.