Comments (4)
角标是server端通过调用阿里云api推送时候设置,
app接到推送后,内部会自动把设置的角标设置到app上。
如果想自己设置角标:
AliyunPush.setApplicationIconBadgeNumber(5);
获取当前角标:
AliyunPush.getApplicationIconBadgeNumber((num)=>{
console.log("ApplicationIconBadgeNumber:" + num);
});
from react-native-aliyun-push.
@wonday ios你没有测试吧?
from react-native-aliyun-push.
目前我的实现方法和你的想法不一样。
我的方法是:
- 自己服务器端维护用户通知数量
- 给用户通知时把这个数量带过去,
- app端这个模块收到通知时把角标设置上去。
目前android和ios都可正常使用。
我看阿里增加了一些接口,就是你想要用的。
他的流程是:
- 推送时不用提供角标数量,设置自增标记。
- iOS端sdk收到后会设置到角标,同时要求用户把app端角标同步到阿里云服务器供下一次自增用。
阿里云的方案的好处时不用我们app服务端记录角标数, 缺点是没有android对应设置。
你的修改方案可能还不彻底,可能会和我的方案有干扰,我看看能否兼容考虑一下,下个版本修改。
from react-native-aliyun-push.
@wonday 我这边的需求是,接受到消息在icon显示角标数量,点击app进去后,清空所有的数量。在android上是没问题的,由于我使用openAPI推送ios设置自增长角标,角标是由阿里中进行维护。所以我需要置0数量,需要使用到同步的方法。
我在PR中只是在IOS中加了同步角标的方法。
from react-native-aliyun-push.
Related Issues (20)
- ios didRegisterForRemoteNotificationsWithDeviceToken 没有执行,获取不到deviceToken HOT 1
- iOS 收到通知后,点击通知,启动APP仅停留在首页,不跳转到对应参数页面
- alicloud-android-utdid-1.1.5.4 相关
- ios 后台运行的时候不触发监听 HOT 2
- [Android] How do I override MessageReceiver HOT 1
- not work android(Task :app:processDebugManifest FAILED) HOT 2
- 请问安卓离线推送时,服务端怎么填推送路径呢? HOT 1
- 请问如何配合服务端的badge 角标自增长?怎样监听APP在后台时获取到通知呢? HOT 1
- 厂商通道小米 HOT 1
- 杀死app的情况下,使用小米厂商通道,收到了通知但是点击通知不能唤起app HOT 3
- Feature request: A way to determine wether to display notification or not while app is at foreground
- app偶发闪退问题
- 在ios上面报编译错误 :use of undeclare identifier "AliyunPushManager" HOT 1
- 安卓打包release后获取不到deviceId
- How to remove the operation of app initialization to obtain notification permission HOT 4
- When you close the APP, you don't receive notifications. When you open the APP, you receive notifications HOT 11
- Android vendor channel received message corner markers cannot be set
- 麻烦问下 ios的集成有案例吗,我想看一下,我这边始终配不好 HOT 1
- 安卓集成后,app在后台如何点击推送唤醒app HOT 1
- Android12的匹配方案-已完成并验证上架
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 react-native-aliyun-push.