首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >将UrbanAirship库从8.3.2升级到9.0.0

将UrbanAirship库从8.3.2升级到9.0.0
EN

Stack Overflow用户
提问于 2019-04-25 08:53:06
回答 1查看 219关注 0票数 0

推送通知对我来说不能正常工作,因为我使用的是旧的城市飞艇(现在简单地更名为飞艇) SDK。我使用的是8.3版,需要升级到9.0.0版。我正在阅读https://github.com/urbanairship/android-library/blob/master/documentation/migration/migration-guide.md以获取有关如何升级的说明。我找到了与我的案例相关的这一部分:

UrbanAirship库8.x到9.0.0

GCM

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

我在源代码中发现了两个AndroidManifest.xml文件:

  1. C:\Userspath\app\src\main\AndroidManifest.xml

<!-- Optional: Receives push and registration events from the Urban Airship SDK. -->

  1. C:\Userspath\app\build\intermediates\exploded-aar\com.urbanairship.android\urbanairship-sdk\8.3.2\AndroidManifest.xml

代码语言:javascript
复制
    <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文件,一旦我升级到9.7.1版本,我的文件应该是这样的,对吗?然后,我应该在我的项目中包含在https://github.com/urbanairship/android-library/tree/master/urbanairship-gcm/src/main/java/com/urbanairship/push/gcm中列出的文件/类。对,是这样?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-04-30 09:00:40

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

代码语言:javascript
复制
// 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 Platform 28 (platforms;android-28)
  2. Replaced compileSdkVersion 23 compileSdkVersion 28 in `build.gradle (Module: app)

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55840387

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档