mirror of
https://github.com/timepill/timepill-app.git
synced 2025-04-30 09:59:31 +08:00
push 初始化
This commit is contained in:
parent
c7c6034404
commit
cc73373878
1 changed files with 6 additions and 2 deletions
|
@ -3,16 +3,19 @@ import XGPushModule from 'react-native-smart-xgpush';
|
|||
const XGPushNativeModules = NativeModules.XGPushModule;
|
||||
|
||||
function init(cb) {
|
||||
XGPushNativeModules.enableDebug(true);
|
||||
if(Platform.OS ==='android'){
|
||||
XGPushNativeModules.enableDebug(true);
|
||||
XGPushModule.notifyJSDidLoad(() => {
|
||||
XGPushModule.registerPush();
|
||||
initOtherPush();
|
||||
cb()
|
||||
});
|
||||
} else {
|
||||
cb()
|
||||
cb();
|
||||
}
|
||||
setAccount("12", (r) => {
|
||||
console.log('setAccount:', r)
|
||||
})
|
||||
}
|
||||
|
||||
function initOtherPush() {
|
||||
|
@ -28,6 +31,7 @@ function initOtherPush() {
|
|||
function setAccount(uid, cb) {
|
||||
if(Platform.OS === 'ios'){
|
||||
XGPushModule.setAccount(uid,cb);
|
||||
|
||||
}else{
|
||||
XGPushModule.bindAccount(uid,cb);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue