Coder Social home page Coder Social logo

jeepeng / react-native-xinge-push Goto Github PK

View Code? Open in Web Editor NEW
78.0 5.0 29.0 7.15 MB

信鸽推送React Native版,支持华为、小米、魅族官方推送通道

License: Apache License 2.0

Java 31.34% JavaScript 13.20% Python 2.02% Objective-C 53.44%
react-native react-native-library xinge xinge-push xgpush react-native-xinge-push react-native-push

react-native-xinge-push's People

Contributors

jeepeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

react-native-xinge-push's Issues

升级到 0.6后, ios 不调用 register 方法

原来用 react-native-xinge-push 0.3 版本上,android, ios 推送都正常。
升级到 0.6 版 , android 版本推送正常, ios 上连 register 都不调用
0.6 版时,信鸽iOS SDK 升级到 v3.1.0,同时按说明的方法修改了 AppDelegate.m 中代码。

_initPush() {
	let accessId;
	let accessKey;
	
	if (IS_ANDROID) {
		accessId = 00000000;
		accessKey = 'xxxxxxxxxx';
	} 
	else {
		accessId = 0000000000;
		accessKey = 'xxxxxxxxx';
	}

	XGPush.enableDebug(true);
	XGPush.init(accessId, accessKey);

	XGPush.register('userid');
}
_onRegister(deviceToken) {
	Alert.alert('_onRegister', 'deviceToken: ' + deviceToken);
}

componentDidMount() {
	XGPush.addEventListener('register', this._onRegister);
	XGPush.addEventListener('notification', this._onNotification);
	if (IS_ANDROID) {
		XGPush.addEventListener('message', this._onMessage);
	}
    }

请问一下是会是什么原因?

调试下来好像 react-native-xinge-push-0.6\ios\XGPush\XGPushManager.m 中的 + (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken 方法没有被调用。

但是 AppDelegate.m 中增加的 - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken 方法可以被用

build.gradle manifestPlaceholders 设置

manifestPlaceholders = [
XG_ACCESS_ID: "2100209996",
XG_ACCESS_KEY: "AHW931HVZ42A",
HW_APPID: "100225811",
PACKAGE_NAME: "com.jeepeng.push"
]

这里的配置起到的作用是什么?? 代码中配置的优先级是哪个

消息点击事件以及跳转页面方法

当 app 处于关闭状态时,能收到通知,但当点击通知后 打开 app 时 onNotification 回调函数不会被调用,app 处于 active 状态是可以触发 onNotification 函数的。

xinge 官方有 android 的跳转方法,但是 RN 该怎么处理呢?求解答!!!

我想请问下,近期有sdk4.0.3的计划吗

描述
请清晰简洁地描述你遇到的问题

复现步骤
重现bug的步骤:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

预期的行为
请清晰简洁地描述你预期会发生什么

截图
如果需要,请添加屏幕截图以帮助解释您的问题

手机 (请填写下面信息):

  • 手机型号: [e.g. 华为 Mate 9]
  • 系统版本: [e.g. Android 8.0]
  • 版本 [e.g. 0.6]

附加信息
在这里添加关于问题的其他信息

Unmount 中再调用 registerForXG ?

componentWillUnmount 中调用 XGPush.removeEventListener('register', this._onRegister);
_onRegister 中调用 XGPush.registerForXG

unmount 中再用 registerForXG ? 有什么作用

我调试发现,销毁组件时 componentWillUnmount 执行,this._onRegister 并没有随即执行,而是下次组件再显示时,调用 componentDidMount 后,this._onRegister会执行两次,一次是 removeEventListener 时调用的

_onRegister(deviceToken) {
  Alert.alert('_onRegister', this.state.status+ ':' + deviceToken);
  XGPush.registerForXG(deviceToken);
}
componentDidMount() {
  this.state.status = 'mount';
		
  XGPush.addEventListener('register', this._onRegister);
  XGPush.addEventListener('message', this._onMessage);
  XGPush.addEventListener('notification', this._onNotification);
}
	
componentWillUnmount() {
  this.state.status = 'unmount';

  XGPush.removeEventListener('register', this._onRegister);
  XGPush.removeEventListener('message', this._onMessage);
  XGPush.removeEventListener('notification', this._onNotification);
}

求完整demo

哥们 可不可以给个完整的demo 比如react-native 的js里面怎么写,ios的delegate怎么写 现在这个有各种问题呀

Support latest XinGe native SDK

XinGe has released new versions for native SDK, would you please support that?

http://xg.qq.com/ctr_index/download

Android SDK
V3.2.6 2018-09-11

  1. 升级小米通道,修复安全漏洞
  2. 修复已知crash
  3. 修复无法清除通知bug

iOS SDK
V3.2.0 2018-09-11

  1. 增加清除、替换接口
  2. 解绑和绑定支持多标签
  3. 增加角标设置接口,实现角标+1
  4. 增加单推统计逻辑

注册问题

跑了示例代码,deviceToken的alert没有弹出来,应该没有成功注册信鸽,请问这是什么问题?

Android 集成指南?

主要是不太清楚 AndroidManifest.xml 和 proguard-rules.pro 是否要做任何配置?

android bindaccount 没有效果,但是result返回devicetoken了,log日志输入如下信息

android XGPushManager.bindAccount推送显示没有账号,但是。then方法result返回devicetoken了,安卓log日志输入如下信息
[XGOtherPush] Reservert info: other push token is : null other push type: xiaomi
05-31 20:41:59.383 27622-27717/com.bunnyfit_app I/XINGE: [XGOtherPush] Reservert info: use normal xg token register
05-31 20:41:59.558 27622-27717/com.bunnyfit_app I/XINGE: [XGOtherPush] other push token is : null other push type: xiaomi
05-31 20:41:59.558 27622-27717/com.bunnyfit_app W/XINGE: [XGOtherPush] updateToken Error: get otherPushType or otherPushToken is null @Jeepeng

android集成不成功

android集成是否是先按照官方文档集成,然后再link xinge-push?
但是我这样做以后在registerPush步骤报错:
XGPushManager.register.rgisterPush got 3 arguments expected 2
如果直接install xinge-push然后再link连推送都收不到。

求教android集成的大概思路。谢谢! @Jeepeng

iOS集成

描述
Undefined symbols for architecture arm64:
"_sqlite3_bind_int64", referenced from:
___28-[XGMTAStore storeEvent:CB:]_block_invoke in libXGPush.a(MTAStore.o)
"_sqlite3_bind_text", referenced from:
___28-[XGMTAStore storeEvent:CB:]_block_invoke in libXGPush.a(MTAStore.o)
"_sqlite3_clear_bindings", referenced from:
___28-[XGMTAStore storeEvent:CB:]_block_invoke in libXGPush.a(MTAStore.o)
"_sqlite3_close", referenced from:
-[XGMTAStore closeDB] in libXGPush.a(MTAStore.o)
"_sqlite3_exec", referenced from:
-[XGMTAStore updateDatabase:] in libXGPush.a(MTAStore.o)
_execute_query in libXGPush.a(MTAStore.o)
_execute_update in libXGPush.a(MTAStore.o)
"_sqlite3_finalize", referenced from:
___28-[XGMTAStore storeEvent:CB:]_block_invoke in libXGPush.a(MTAStore.o)
"_sqlite3_free", referenced from:
-[XGMTAStore updateDatabase:] in libXGPush.a(MTAStore.o)
_execute_query in libXGPush.a(MTAStore.o)
_execute_update in libXGPush.a(MTAStore.o)
"_sqlite3_open", referenced from:
-[XGMTAStore getDB] in libXGPush.a(MTAStore.o)
"_sqlite3_prepare_v2", referenced from:
___28-[XGMTAStore storeEvent:CB:]_block_invoke in libXGPush.a(MTAStore.o)
"_sqlite3_reset", referenced from:
___28-[XGMTAStore storeEvent:CB:]_block_invoke in libXGPush.a(MTAStore.o)
"_sqlite3_step", referenced from:
___28-[XGMTAStore storeEvent:CB:]_block_invoke in libXGPush.a(MTAStore.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

复现步骤
重现bug的步骤:
在xg上配置完证书,后真机运行

预期的行为
正常运行
截图
1536306664672
手机 (请填写下面信息):
iPhone8
"react": "16.3.1",
"react-native": "^0.55.4",
附加信息
在这里添加关于问题的其他信息

iOS 10以上 点击消息不能响应 didReceiveNotificationResponse

AppDelegate.m 已经增加

- (void)xgPushUserNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler {
	NSLog(@"[XGPush] click notification");

	[[XGPush defaultManager] reportXGNotificationResponse:response];
	
	completionHandler();
}

收到消息后,点击消息,可以打开应用,但不能响应 notification 事件,这样就不能取得消息中的数据,调试提示出现如下错误
Warning: UNUserNotificationCenter delegate received call to -userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler: but the completion handler was never called.

请问会是什么原因?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.