react-native-aliyun-push
Advanced tools
Comparing version
@@ -42,6 +42,4 @@ /** | ||
static getDeviceId = (callback) => { | ||
AliyunPushNative.getDeviceId(function(args) { | ||
callback(args); | ||
}); | ||
static getDeviceId = () => { | ||
return AliyunPushNative.getDeviceId(); | ||
} | ||
@@ -48,0 +46,0 @@ |
{ | ||
"name": "react-native-aliyun-push", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "A react native wrapper for aliyun push SDK", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,2 +9,26 @@ # react-native-aliyun-push | ||
v1.0.12 | ||
1. getDeviceId()逻辑处理变更为一次取得失败后延迟三秒再次获取 | ||
2. ```重要变更```getDeviceId()接口变更为Promise模式,使用旧版本需要升级代码。 | ||
**v1.0.11及以前代码用法:** | ||
``` | ||
AliyunPush.getDeviceId((deviceId)=>{ | ||
console.log("AliyunPush DeviceId:" + deviceId); | ||
}); | ||
``` | ||
**v1.0.12及以后代码用法:** | ||
``` | ||
AliyunPush.getDeviceId() | ||
.then((deviceId)=>{ | ||
//console.log("deviceId:"+deviceId); | ||
}) | ||
.catch((error)=>{ | ||
console.log("getDeviceId() failed"); | ||
}); | ||
``` | ||
v1.0.11 | ||
@@ -294,5 +318,9 @@ | ||
``` | ||
AliyunPush.getDeviceId((deviceId)=>{ | ||
console.log("AliyunPush DeviceId:" + deviceId); | ||
}); | ||
AliyunPush.getDeviceId() | ||
.then((deviceId)=>{ | ||
//console.log("deviceId:"+deviceId); | ||
}) | ||
.catch((error)=>{ | ||
console.log("getDeviceId() failed"); | ||
}); | ||
``` | ||
@@ -299,0 +327,0 @@ **绑定账号** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
40077023
0633
2.1%492
6.03%