Badge Notification shows up after reinstalling ionic app on IOS - ios

I am using ionic framework and I am showing badge notifications following this article
https://ionicframework.com/docs/native/badge/
I first installed the app (in IOS), calculated badges and closed the app. Now badges are still there on app icon. Now when I delete the app and reinstalled it, same number of badges are showing up, over the icon. I don't want this thing to happen.
I have read that it takes 1 day to get the app data cleaned up after deletion.
I have followed many solutions to remove device memory for the app when we delete it, this is from within the ios device, but I need a solution from coding perspective. Is there any way I can add some thing on config.xml or install any package that remove app data instantly when we delete the app in IOS?
I have following these articles, but nothing working.
ionic set badge after push notification
iOS reinstalling app does not clear badges
https://developer.apple.com/library/archive/technotes/tn2265/_index.html

there's a cordova plugin which handles badge staus on app icon.
Cordova Badge Plugin
cordova.plugins.notification.badge.clear();
hope you'd get a hint from this plugin. thanks

Related

OneSignal iOS Settings keeps disappearing

I'm currently working on implementing push notification for my app using React Native and OneSignal. I've managed to set the settings for Android and iOS, but I noticed the iOS side keeps disappearing from time to time and appearing again. Same thing with the dashboard, the iOS logo sometimes appear and disappear.
When trying to send notification while only targeting my iOS device, sometimes the system would show Total Number of Recipient to be 0 as well. The device itself only received the notifications from time to time while the android side always received them.
Anyone ever have this issue as well? And did you managed to solve it?
EDIT:
I cannot seem to find a way to fix this so I decided to do a workaround instead by creating another project inside OneSignal and disable the old one. The push notification is working fine now.
OneSignal fixed this issue today with the dashboard not saving/persisting data. You should be able to save your settings now. Best to contact OneSignal directly with issues like this.

how to remove iOS app meta data (like push notifications badge, use widget flag, ..)

I didn't find a similar question or useful info on this topic.
I just want to remove my app from iPhone and get a completely fresh version with no caching nor meta caching...
examples of meta caching
1- Push notification badge.
2- Apple App Site Association.
3- whether to show the app widget or not.
When I delete the app and install it again, the push notifications badge still shows '1', and the app widget get's added automatically.
so there's metadata stored on the iPhone for my app, ... where is it? and how to reset it?
I can reset the simulator of iOS and get a clean build 100%, but this won't help because what I need is a fresh version of the Apple-App-Site-Association file, this is only testable on the iOS device, and not testable on the simulator.
I tried to delete files using iExplorer mac app, no clue there.
any hints?

why does my phonegap app restart if kept in background for long

my phonegap app restarts if kept in background for long. For example if i open my app the next day it relaunches rather than starting from where i left off. Otherwise it seems to preserve state perfectly.
I see this happening for some other apps too that are installed on the iphone like instagram, twitter, but not for facebook and whatsapp. Does iOS kill apps if in background for long? Can i prevent this?
I am using Phonegap CLI 6.0.1 (cordova build version 4.0.1) testing on iOS9. Let me know if any other information is needed. Thanks!
iOS will kill apps when it needs the resources. There is nothing you can do to prevent your app from being killed (by iOS or the user). This has nothing to do with your app being made with phonegap (or anything else).
You need to code your app to handle being killed. When the user chooses to use your app again (after it happened to be killed), your app should launch right back to where it was, restoring its previous state. This is what all good apps do.

Cordova ios app is not showing up in notifications center

I started having a problem with my Cordova app just a few days ago. The app will not show up in notifications center anymore, despite my tries to re-install the push plugin, re-new all certificates and provision profiles. The plugin I am using is the Phonegap Push Notifications. I did notice that it still has "Notifications" setting in the app preferences in iOS Simulator, although I don't think that counts as much.
Does anybody have an idea of what's going on? I really appreciate any help you can provide.

Create Geolocation plugin for phonegap iOS to run in background

since watchposition doesn't run for more than 30 min in background, i have to create a geolocation plugin in order to register position every 5 minute on my webserver.
Ther problem is that i don't know quite nothing about objective-c. So anyone can help me or give me some parts of code with i can do something? thanks in advance
You don’t need to create a plugin for your phonegap app to receive location updates in the background. I’ve produced an iOS version of my phonegap-based navigator app and successfully got it receiving position updates while running in the background. I’ve tested it extensively in the “real-world” and it works reliably without any limit on the duration for receiving location updates.
Firstly, you need to be using XCode to develop your phonegap app - I’m not sure you can set the correct properties in your iOS app if you’re using Phonegap Build. You can set the “UIBackgroundModes” key with a value of “location”, which will cause iOS to trigger the JS callback function you have registered with watchPosition() each time a location update is received.
See this page for details about iOS project keys.
See this page for how to set the background modes key in XCode. The value you want to select is “App registers for location updates”.
Hope this helps!

Resources