Play services API表明有一种叫做Instance ID的东西。
但是,在Android Studio中包含以下内容后,我无法导入InstanceID类
compile "com.google.android.gms:play-services-identity:${googlePlayServicesVersion}"
compile "com.google.android.gms:play-services-auth:${googlePlayServicesVersion}"根据这个SO Post,如果我包含identity play服务库,InstanceID类应该可以工作。
在谷歌云消息转换为firebase云消息之后,我相信它一定已经被here红色消息中提到的Firebase实例ID所取代。
现在我不确定使用Firebase ID是否真的应该“替换”实例ID。
或者,也许我遗漏了一些包含InstanceID的库?
发布于 2018-02-01 23:50:34
是啊,
我遇到了这个问题,最后我意识到InstanceID类是gradle库的一部分,所以您只需在gradle构建文件中添加下面这一行:
compile "com.google.android.gms:play-services-iid:${googlePlayServicesVersion}"除非这对我有效:) ...
https://stackoverflow.com/questions/48171823
复制相似问题