当我尝试更新我的应用程序时 - 在审核过程中出现错误。隐式 PendingIntent 漏洞的修复 - https://support.google.com/faqs/answer/10437428。在我的应用程序中,我正在创建 PendingIntent - 用于 Firebase 推送通知:
内部类 FCMService 扩展了 FirebaseMessagingService
@Override
public void onMessageReceived(@NotNull RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
Intent intent = new Intent(this, ApplicationActivity.class);
intent.setAction("com.google.firebase.MESSAGING_EVENT");
intent.setPackage(getApplicationContext().getPackageName());
Map<String, String> data = remoteMessage.getData();
for (Map.Entry<String, String> entry : data.entrySet()) {
String value = entry.getValue();
String key = entry.getKey();
if (key.equals(ApplicationActivity.LINK_URL) ||
key.equals(ApplicationActivity.FLOCKTORY_LINK_URL)) {
intent.putExtra(ApplicationActivity.FLOCKTORY_LINK_URL, value);
if (remoteMessage.getNotification() != null && remoteMessage.getNotification().getTitle() != null) {
intent.putExtra(ApplicationActivity.HMS_PUSH_TITLE, remoteMessage.getNotification().getTitle());
}
}
}
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, …Run Code Online (Sandbox Code Playgroud) java android google-play huawei-mobile-services huawei-push-notification
我正在使用以下代码片段,但是我仍然无法获取 pushToken。
private void obtainToken() {
// get token
new Thread() {
@Override
public void run() {
try {
String appId = AGConnectServicesConfig.fromContext(MainActivity.this).getString("client/app_id");
pushtoken = HmsInstanceId.getInstance(MainActivity.this).getToken(appId, "HCM");
if(!TextUtils.isEmpty(pushtoken)) {
Log.i(TAG, "get token:" + pushtoken);
}
} catch (Exception e) {
Log.i(TAG,"getToken failed, " + e);
}
}
}.start();
}
Run Code Online (Sandbox Code Playgroud) android push push-notification huawei-mobile-services huawei-push-notification
我正在尝试将华为地图套件用于不包含 Google Play 服务的新设备。Codelab 演示位于:
https://developer.huawei.com/consumer/en/codelab/HMSMapKit/index.html#7
我没有更改演示的任何一行代码,该应用程序已自动下载华为移动服务版本3.0.3.300。
但是,地图仍然没有出现。
你遇到过同样的问题吗?
我收到此日志:
01-26 14:24:34.265 19265-19265/com.wz.android.mapdemo W/DynamicModule: Failed to load remote module.
01-26 14:24:34.256 19265-19265/com.wz.android.mapdemo D/HmsMapKit_MapView_183: onStart
01-26 14:24:34.257 19265-19265/com.wz.android.mapdemo I/HmsMapKit_MapCreator_48: Making Createor dynamically
01-26 14:24:34.257 19265-19265/com.wz.android.mapdemo I/DynamicModule: Local module huawei_module_maps:0
01-26 14:24:34.257 19265-19265/com.wz.android.mapdemo I/DynamicModule: Remote module huawei_module_maps:-100
01-26 14:24:34.259 19265-19265/com.wz.android.mapdemo W/DynamicModule: Failed to load remote module.
com.huawei.hms.feature.dynamic.DynamicModule$LoadingException: f*i*e* *o*l*a* *o*u*e
at com.huawei.hms.feature.dynamic.DynamicModule.a(Unknown Source)
at com.huawei.hms.feature.dynamic.DynamicModule.a(Unknown Source)
at com.huawei.hms.feature.dynamic.DynamicModule.load(Unknown Source)
at com.huawei.hms.maps.internal.MapCreator.getRemoteContext(MapCreator.java:97)
at com.huawei.hms.maps.internal.MapCreator.getRemoteMapContext(MapCreator.java:85)
at com.huawei.hms.maps.internal.MapCreator.getCreator(MapCreator.java:50)
at com.huawei.hms.maps.MapView$MapViewDeferredLifecycleHelper.createDelegate(MapView.java:241)
at com.huawei.hms.feature.dynamic.DeferredLifecycleHelper.a(Unknown Source)
at com.huawei.hms.feature.dynamic.DeferredLifecycleHelper.onStart(Unknown …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用android.location.GeocoderHMS(华为移动服务)设备上的 对纬度/经度坐标进行地理编码,但结果我一直得到一个空列表。
val result = geoCoder.getFromLocation(latitude, longitude, MAX_RESULTS) // [] on HMS
Run Code Online (Sandbox Code Playgroud)
为了验证这实际上应该起作用,我检查了Geocoder.isPresent()哪个返回true.
查看 LogCat 输出,我可以看到以下几行,这表明我缺少某些 API 密钥或未正确配置某些内容...
XX/? I/HwGeoCoderProvider: [I/HwLocation/HwGeoCoderProvider 1877:388 HwGeoCoderProvider.java:136] onGetFromLocation: start to GetFromLocation
XX/? D/HwGeoCoderProvider: [D/HwLocation/HwGeoCoderProvider 1877:388 HwGeoCoderProvider.java:434] exceed max requesting limit
XX/? D/HwGeoCoderProvider: [D/HwLocation/HwGeoCoderProvider 1877:388 HwGeoCoderProvider.java:162] exceed max requesting limit
XX/? I/HwGeoCoderProvider: [I/HwLocation/HwGeoCoderProvider 1877:388 HwGeoCoderProvider.java:455] {callTime=..., service=hwLocation, rom_type=1001, transId={{some uuid}}, package=com.android.phone, apiName=GeoCode_getFromLocation, costTime=1, result=10400}
Run Code Online (Sandbox Code Playgroud)
我在 P40 Pro 上尝试了这个,它安装了最新的 HMS Core 版本 (5.0.0.304)。我之前收到过一些结果,所以它确实有效,但它显然达到了这个限制并停止工作。
如何android.location.Geocoder在 …
android reverse-geocoding huawei-mobile-services huawei-location-kit
我需要在 os 中上传我的 android apk 文件,并且由于该平台禁止谷歌服务,我将不得不使用替代平台。这是我使用过的谷歌服务列表。请帮助我区分我需要覆盖和重新编码的 Google 服务Harmony OS。
com.google.android.material
com.google.firebase
com.google.android.gms:play-services-auth
com.google.android.gms:play-services-maps
com.google.android.gms:play-services-location
com.google.android.libraries.places
com.google.code.gson
com.google.protobuf.nano:protobuf-javanano
Run Code Online (Sandbox Code Playgroud) android huawei-mobile-services appgallery huawei-developers harmonyos
您好,我在获取附近位置时遇到此错误。
PS 我的设备没有 SIM 卡,如果您认为这会是个问题,请告诉我。
responseErrorCode errorCode = 10017 errorReason = SIGNATURE_INVALID
Run Code Online (Sandbox Code Playgroud)
我在这里搜索过,但找不到原因。 结果代码链接
这是build.gradle中提到的证书
signingConfigs {
config {
storeFile file('keystore.jks')
storePassword '*****'
keyPassword '*****'
keyAlias 'key'
v1SigningEnabled true
v2SigningEnabled true
}
}
Run Code Online (Sandbox Code Playgroud)
这里是完整的日志。
I/HMSSDK_PendingResultImpl: setResult:0 I/HMSSDK_BaseAdapter: baseCallBack.onComplete I/HMSSDK_HmsClient: 接收消息 status_code:0, error_code0, api_name:location.requestLocationUpdates, app_id:104565291|, session_name:com.ogoul_id:kalam,TRANSACTION_ID:104565291pdates20210813103016514894175,分辨率:空I / HMSSDK_RequestLocationUpdatesTaskApiCall:| 71d9bb75-f532-45e2-8e2f-4cbd89a41eb2 | doExecute I / HMSSDK_TidCacheManager:| 71d9bb75-f532-45e2-8e2f-4cbd89a41eb2 |列表来查找大小为:1 I / HMSSDK_TidCacheManager: | 71d9bb75-f532-45e2-8e2f-4cbd89a41eb2 |找到TID列表,TID:71d9bb75-f532-45e2-8e2f-4cbd89a41eb2 I / HMSSDK_RequestLocationUpdatesTaskApiCall:| 71d9bb75-f532-45e2-8e2f-4cbd89a41eb2 | doExecute onLocationResult I / HMSSDK_RequestLocationUpdatesTaskApiCall:| 71d9bb75 -f532-45e2-8e2f-4cbd89a41eb2 |修改与回调numUpdates,numUpdates:2147483647,locationSize:1 I / HMSSDK_RequestLocationUpdatesTaskApiCall:| 71d9bb75-f532-45e2-8e2f-4cbd89a41eb2 …
java android kotlin huawei-mobile-services huawei-developers
我可以在华为应用市场(华为商店)的安卓应用中使用 AdMob 广告吗?
如果没有,我可以使用哪些广告网络?
ChromeCustomTabs uses Chrome, SafariViewController uses Safari. Is there an alternative for Huawei (Huawei Browser). Can I use Huawei Browser as an in-app browser?
browser safari google-chrome huawei-mobile-services huawei-browser
当我将 pushSDK 更新到版本“5.3.0.301”时,我发现AGConnectServicesConfig它已被弃用。我想知道它的替代品是什么。如何在新版本中获取 app_id?我曾经像这样获得 app_id:
String appId = AGConnectServicesConfig.fromContext(context).getString("client/app_id");
Run Code Online (Sandbox Code Playgroud)
更新时如何获取?
我找到了源代码,但我找不到任何替代品。
android push-notification kotlin huawei-mobile-services huawei-push-notification
现在华为发布他们的新操作系统会发生什么?如果它爆炸了,而且很有可能会爆炸,那么在访问一个全新的平台方面就会出现巨大的差距。我选择了简单的方法,并且一直在通过 React-Native 为 iOS 和 Android 开发移动应用程序。React-Native 会支持鸿蒙吗?
我使用华为的Push Kit向华为设备推送消息,SDK版本为4.0.3.300。我可以正确获取token,所以我开始使用Postman调用Push Kit server API来推送消息。返回的消息正文显示成功,但我的设备没有收到任何消息。以下是代码和我的操作。我应该怎么做来处理这个问题?邮递员电话地址:
POST https://push-api.cloud.huawei.com/v1/[myappid]/messages:send
发送的消息体:
{
"validate_only": true,
"message": {
"data": "my data",
"android": {
"fast_app_target": 2
},
"token": [
"my token"
]
}
}
Run Code Online (Sandbox Code Playgroud)
回复:
{
"code": "80000000",
"msg": "Success",
"requestId": "158929224618234594000607"
}
Run Code Online (Sandbox Code Playgroud)
响应表示成功,但我的设备没有收到任何数据消息。
我已经继承了 HmsMessageService 并在清单文件中对其进行了配置。
public class MyPushService extends HmsMessageService {
private static final String TAG = "hmspush";
@Override
public void onMessageReceived(RemoteMessage message) {
Log.i(TAG, "onMessageReceived is called");
if (message == null) {
Log.e(TAG, "Received message entity is null!");
return;
}
Log.i(TAG, "getCollapseKey: " …Run Code Online (Sandbox Code Playgroud) android push-notification kotlin huawei-mobile-services huawei-push-notification
android ×9
kotlin ×3
google-play ×2
harmonyos ×2
java ×2
admob ×1
ads ×1
appgallery ×1
browser ×1
dictionary ×1
push ×1
react-native ×1
safari ×1