【问题标题】:Migrate from C2DM to GCM for Android SDK 19从 C2DM 迁移到 GCM for Android SDK 19
【发布时间】:2016-11-26 15:26:12
【问题描述】:

我有一个适用于 Android SDK 19 的应用程序,它是为使用 C2DM 而编写的。我需要将它迁移到 GCM。我面临下一个问题:

  1. 实际上没有 /extras/google/google_play_services/libproject/google-play-services_lib/ 文件夹。据我从here 了解到,它已被 Google Repository 库取代并分成不同的部分
  2. GCM 位于过时的库中Google Cloud Messaging
  3. 我有一些 google-play-services_lib(从某处下载 android:versionCode="3265130" android:versionName="3.2.65 (834000-30)" uses-sdk android:minSdkVersion="8")但是当我尝试将此库导入我收到java.lang.ClassNotFoundException error after build on TeamCity side 的项目中

问题是:

  1. 如果我将这个旧库包含到我的项目中,是否有可能在新的 Android 操作系统下使用旧的 google-play-services_lib?
  2. 是否可以通过使用旧的 google-play-services_lib 来使用 GCM?
  3. 导入 google-play-services_lib 有什么问题?

【问题讨论】:

    标签: java android eclipse google-cloud-messaging google-play-services


    【解决方案1】:

    尝试迁移到 Firebase,而不是使用 GCM

    Google 现在建议使用 Firebase 通知

    https://firebase.google.com/

    【讨论】:

      【解决方案2】:

      我建议您遵循本指南 将适用于 Android 的 GCM 客户端应用程序迁移到 Firebase 云消息传递:https://developers.google.com/cloud-messaging/android/android-migrate-fcm

      Firebase:https://firebase.google.com/

      我认为本指南非常有用。

      【讨论】:

      • 您共享的 firebase 链接适用于 firebase 旧版控制台,它是 firebase 的旧版本。新链接firebase.google.com
      猜你喜欢
      • 1970-01-01
      • 2012-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多