Comments (10)
建议先使用stable版本的flutter sdk
这个是一个flutter sdk的破坏性修改带来的
我只是一个三方贡献者, 你还是需要找官方的人,看看他们能不能快速解决.
如果明天还需要解决的话,我可以提交一个PR看官方人员会不会接收吧
from jpush-flutter-plugin.
@fcloud89 然而没人响应这个pr
So, 你可以用我fork的那个版本先试试看
用git依赖
修改: 以前的ref是错的, 请用以下的引用方式
dependencies:
jpush_flutter:
git:
url: https://github.com/CaiJingLong/jpush-flutter-plugin.git
ref: 4d847f9b2150dc4fd1f8a7620d414d60f464fab7
from jpush-flutter-plugin.
之前的ref 留错了 尴尬..
用这个ref试试:
dependencies:
jpush_flutter:
git:
url: https://github.com/CaiJingLong/jpush-flutter-plugin.git
ref: 4d847f9b2150dc4fd1f8a7620d414d60f464fab7
from jpush-flutter-plugin.
我的办法是在jpush插件配置文件AndroidManifest.xml内的receiver里添加android:process="包名"
这样不会影响jpush的调试 但是不同的工程还要挨个改 有点麻烦 没办法 只能等官方修复这个问题了
from jpush-flutter-plugin.
@fcloud89 然而没人响应这个pr
So, 你可以用我fork的那个版本先试试看
用git依赖dependencies: jpush_flutter: git: url: https://github.com/CaiJingLong/jpush-flutter-plugin.git ref: e9e0e3dc5f420d5d4f1738f99e41597d7f51dbbd
安装这个插件 在flutter1.7.8+hotfix.3上依旧会崩溃
from jpush-flutter-plugin.
把callback.success(res);、callback.error(Integer.toString(msg.arg2), "", "");切换回主线程;
public class JPushEventReceiver extends JPushMessageReceiver {
Handler handler=new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
Result callback = JPushPlugin.instance.callbackMap.get(msg.arg1);//instance.eventCallbackMap.get(sequence);
switch (msg.what){
case 0:
if (callback == null) {
Log.i("JPushPlugin", "Unexpected error, callback is null!");
return;
}
Map<String, Object> res= (Map<String, Object>) msg.obj;
callback.success(res);
break;
case 1:
callback.error(Integer.toString(msg.arg2), "", "");
break;
}
JPushPlugin.instance.callbackMap.remove(msg.arg1);
}
};
@Override
public void onTagOperatorResult(Context context, JPushMessage jPushMessage) {
super.onTagOperatorResult(context, jPushMessage);
JSONObject resultJson = new JSONObject();
int sequence = jPushMessage.getSequence();
try {
resultJson.put("sequence", sequence);
} catch (JSONException e) {
e.printStackTrace();
}
Result callback = JPushPlugin.instance.callbackMap.get(sequence);//instance.eventCallbackMap.get(sequence);
if (callback == null) {
Log.i("JPushPlugin", "Unexpected error, callback is null!");
return;
}
if (jPushMessage.getErrorCode() == 0) { // success
Set<String> tags = jPushMessage.getTags();
if(tags==null)return;
List<String> tagList = new ArrayList<>(tags);
Map<String, Object> res = new HashMap<>();
res.put("tags", tagList);
Message msg=new Message();
msg.arg1=sequence;
msg.what=0;
msg.obj=res;
handler.sendMessage(msg);
// callback.success(res);
} else {
try {
resultJson.put("code", jPushMessage.getErrorCode());
} catch (JSONException e) {
e.printStackTrace();
}
Message msg=new Message();
msg.arg1=sequence;
msg.what=1;
msg.arg2=jPushMessage.getErrorCode();
handler.sendMessage(msg);
// callback.error(Integer.toString(jPushMessage.getErrorCode()), "", "");
}
// JPushPlugin.instance.callbackMap.remove(sequence);
}
@Override
public void onCheckTagOperatorResult(Context context, JPushMessage jPushMessage) {
super.onCheckTagOperatorResult(context, jPushMessage);
int sequence = jPushMessage.getSequence();
Result callback = JPushPlugin.instance.callbackMap.get(sequence);
if (callback == null) {
Log.i("JPushPlugin", "Unexpected error, callback is null!");
return;
}
if (jPushMessage.getErrorCode() == 0) {
Set<String> tags = jPushMessage.getTags();
if(tags==null)return;
List<String> tagList = new ArrayList<>(tags);
Map<String, Object> res = new HashMap<>();
res.put("tags", tagList);
Message msg=new Message();
msg.arg1=sequence;
msg.what=0;
msg.obj=res;
handler.sendMessage(msg);
// callback.success(res);
} else {
Message msg=new Message();
msg.arg1=sequence;
msg.what=1;
msg.arg2=jPushMessage.getErrorCode();
handler.sendMessage(msg);
// callback.error(Integer.toString(jPushMessage.getErrorCode()), "", "");
}
// JPushPlugin.instance.callbackMap.remove(sequence);
}
@Override
public void onAliasOperatorResult(Context context, JPushMessage jPushMessage) {
super.onAliasOperatorResult(context, jPushMessage);
int sequence = jPushMessage.getSequence();
Result callback = JPushPlugin.instance.callbackMap.get(sequence);
if (callback == null) {
Log.i("JPushPlugin", "Unexpected error, callback is null!");
return;
}
if (jPushMessage.getErrorCode() == 0) { // success
Map<String, Object> res = new HashMap<>();
res.put("alias", (jPushMessage.getAlias() == null)? "" : jPushMessage.getAlias());
Message msg=new Message();
msg.arg1=sequence;
msg.what=0;
msg.obj=res;
handler.sendMessage(msg);
// callback.success(res);
} else {
Message msg=new Message();
msg.arg1=sequence;
msg.what=1;
msg.arg2=jPushMessage.getErrorCode();
handler.sendMessage(msg);
// callback.error(Integer.toString(jPushMessage.getErrorCode()), "", "");
}
// JPushPlugin.instance.callbackMap.remove(sequence);
}
}
from jpush-flutter-plugin.
之前的ref 留错了 尴尬..
用这个ref试试:
dependencies: jpush_flutter: git: url: https://github.com/CaiJingLong/jpush-flutter-plugin.git ref: 4d847f9b2150dc4fd1f8a7620d414d60f464fab7
真好用
from jpush-flutter-plugin.
之前的ref 留错了 尴尬..
用这个ref试试:
@wangdenkun
@simeon49dependencies: jpush_flutter: git: url: https://github.com/CaiJingLong/jpush-flutter-plugin.git ref: 4d847f9b2150dc4fd1f8a7620d414d60f464fab7真好用
确定可以用,感谢🙏
from jpush-flutter-plugin.
感谢一波大佬,实时可用
from jpush-flutter-plugin.
最新版本已修复此类问题
from jpush-flutter-plugin.
Related Issues (20)
- 极光推送插件初始化在极光安全认证插件之后调用,会导致极光推送初始化失败,收不推送
- flutter集成闪退 HOT 1
- [iOS][AppStore]`Adaptor iOS privacy manifest` HOT 6
- 2024 Flutter iOS 隐私清单适配。否则五一app全部下架。 HOT 2
- 这玩意没法用啊
- dev3.x分支的example无法运行
- didReceiveRemoteNotification默认返回了YES
- 鸿蒙SDK已经发布了,接口也差不多,flutter啥时候加入?
- 请公开参数设置[JPUSHService setLocationEanable:];
- doesn't show notification when app is closed or terminated
- xcode编译flutter项目时报错,提示xcode compiler error "#import <duq.h>" HOT 1
- 角标数字怎样清除啊?
- 小米审核需要提供位置权限的证明材料
- PlatformException(6002, , , null)#2 JPush.setAlias (package:jpush_flutter/jpush_flutter.dart:278:9)
- MissingPluginException(No implementation found for method getRegistrationID on channel jpush)#1 JPush.getRegistrationID (package:jpush_flutter/jpush_flutter.dart:381)
- 设置别名异常,PlatformException(Error 6027, JPush.Flutter, The operation couldn’t be completed. (JPush.Flutter error 6027.), null) HOT 2
- 分支 dev-3.x 最新提交(更新JPush 540) 导致应用闪退 HOT 5
- flutter 项目小米审核被拒
- 华为推送厂商接入问题 HOT 1
- 应用内消息跳转问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jpush-flutter-plugin.