掌淘SMSSDK遇到的坑—AppKey不存在 状态码406

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cui130/article/details/80827217

问题描述:调用sdk中

RegisterPage page = new RegisterPage();
//如果使用我们的ui,没有申请模板编号的情况下需传null
page.setTempCode(null);
page.setRegisterCallback(new EventHandler() {
   public void afterEvent(int event, int result, Object data) {
      
   }
});
page.show(this);

或者:

CountryPage countryPage = new CountryPage();
countryPage.setCountryId(currentId);
countryPage.setCountryRuls(countryRules);
Log.e("showCountrySelect","page = ");
countryPage.showForResult(mRegisterActivity, null, new FakeActivity() {
   @Override
   public void onResult(HashMap<String, Object> arg0) {
   }

});

获取国家列表界面报网络异常请稍后重试,抓包看到返回状态码406,appKey为null,找客服调了很久,最后换了个客服给的appKey就可以用了,然后切回我的key也可以用了,但是过不一会就又报这个错。

解决方法:把

MobSDK {
    //    appKey "***"
    //    appSecret "*****"

    SMSSDK {
        gui true
    }
}

这个配置的appkey注释掉换到manifest中:

<meta-data android:name="Mob-AppKey" android:value="*******"/>
<meta-data android:name="Mob-AppSecret" android:value="***************"/>

删除代码:

countryPage.setCountryRuls(countryRules);

代码不要混淆,或者按官方指导修改混淆文件。

需要的权限提前申请

这样就没问题了。

猜你喜欢

转载自blog.csdn.net/cui130/article/details/80827217