Set notifications from Today Extension Widget - ios

I am creating a simple timer app which will have a lot of focus on the today extension widget features. Users can start the timer from here by tapping.
The only problem is that I need to set a local notification from the widget. I have tried to use [[UIApplicaton sharedApplication] scheduleLocalNotification] but Xcode throws an error saying that shared application is unavailable in app extension. Is there any solution for setting a local notification from Today extension? Thanks in advance. Any help whatsoever is appreciated.

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.

Open iOS app automatically at a certain time

Is this possible? Like the app will launch at 8AM and closes at 10PM. I'm new to developing an app that uses background. What I do know currently is that the app can run in the background for a long time.
What I also have right now is my project that updates the user location in the background. With the help of this https://github.com/silento/Location - re-written in Swift 3.0.
This is not possible. But, you can use local notifications to tell user to run the app.

iOS 10 Open Today Widget from main App in Swift

I am trying to take the user to my widget on Today screen. So far research has not shown any way to do this. All the solution are for opening the main app from the today widget not the other way around. Any ideas if this is possible?
This is not something that you are able to do, Apple has not provided any methods to allow this type of functionality.

Making auto-start apps in Xamarin.Forms

I'm trying to make kind of a reminder app and for that to work I'll need it to auto start when the phone comes on in order to track the time. Was thinking of using Messaging Center but that would only work when the app is active and running already. I'm using Xamarin.forms so would appreciate if someone could point me in the right direction.
Android has an AlarmManager that can start a service at specific times.
iOS has no such feature, and hence it can't be done on iOS due to security restrictions.
The only think I could think of, is to schedule a LocalNotification on iOS that the user would then have to press to open the app, but at least it would be a reminder of sorts. Not sure if that will suffice.

WCSession and Today Widget

I've an app with a today extension and a watch app. From the main app WCSession works fine and data is transferred to the watch and received correctly but when I try to send or receive data through the WCSession in the today widget the property paired and watchAppInstalled of the session are set to false so calling transferUserInfo: does nothing and session:didReceiveUserInfo: is never called.
I know I can open the app using openURL and then send the new data but I want to do that without leaving Notification Center.
Does anyone know a nice workaround for this problem?
It seems WCsession only works from the iOS app, not from any iOS extensions (share, today, keyboard, etc.), so for now you'll have to "relay" things via the app if you want to get it to the watch.
You should file an enhancement bug report with Apple explaining why you think it should be possible to use it from extensions too!
If the watch app is running in the foreground, you should be able to send it a message via a Darwin notification. Take a look at MMWormhole.

Resources