I'm trying to implement subscriptions with free trial period and I have some issues with testing them. I know that in Sandbox environment the time is speeded up, and that 1 hour in Sandbox is 1 year in real life.
I want to schedule some local notification that will fire two days before finishing the trial period, but if whole subscription takes only 1 hour, then setting notification for 2 days before it (which is then in the past) is obviously impossible.
So the question is: is there a way to disable time acceleration in Sandbox environment? Or do you have some other ideas how to test it?
Thanks for all your help.
Related
I like to get an alarm at some specific time (for example at 8.0 am) and i like to continue it for 1 hour. so it will stop at 9.0 am. I also like it to keep alarming me after 5 or 10 mins. But after 9.0 am it will stop alarming me.
Again it will continue the very next day at 8.0 am. Is it possible to do with local notification or any other way.
TIA
It is not possible to run the code for certain amount of time in background mode. The alarm thing can be done only by apple OS.
But it is possible to get notified for certain amount of time for example get notify for 1 hour by creating multiple notification for that particular one hour and make trigger at that time. Though it is not perfect solution.
This is in response of an effort in order to implement an app in a way, so that I could run some code at specific interval of time i-e Morning 9:00 am daily.
Lets take an example of an Alarm.
If user is allowed to set a time interval, during which he is going to remain busy, so now after setting two - three intervals for his daily schedule.
After the app is suspended or in foreground, user needs a reminder before entering to and after getting out of the interval.
I need guidance for this problem in a way :
Local notifications for this situation in swift
Changing the mode of device from ringer to silent during that interval
OR
Accessing programatically 'Do not Disturb Me' feature of IOS
Your kind conveyance regarding this issue will be really productive for me.
Thanks.
I have a situation with UILocalNotification. I know there is an answer how to cancel a uilocalnotification
My scenario is though:
I would like to remind the user to use the app on daily basis.
If the user doesn't use the app for three days, then I would like to increase the interval from daily to every three days.
If the user still doesn't come back after 6 days, I would like to stop all notifications.
Reading the document it says there is this one method that is called when the app is running: application:didReceiveLocalNotification:. But this is only hit if the app is running at the time of event. What if the user doesn't come back?
Is there anyway my app could cancel all events after a certain number of inactive days have passed? I don't want to keep pestering the user, if there is no interest after all.
The only way is to setup all local notifications when you go to background.
So you same notification several times with different date - each of them are single notification (non repeated).
after 1 day
after 2 days
after 3 days
after 6 days
Each time user opens you up you clean all of them with "cancelAllLocalNotifications" - each time he goes to background you create them all.
I have a local notification in my app that goes off exactly 5 days since the app was last used. I have had a review saying that the sound is annoying when it goes off at midnight. Is there anyway that I can prevent the notification from playing if it is between a certain system time? I really want to keep this notification but I don't want the users to become annoyed with it going off at early hours (even if they were the ones who were on at that time 5 days prior)
Any help would be much appreciated
I ordered a auto-renew product, After 5 minutes ,it become expired!
I think in Sandbox 5 minutes is equal to 1 month,
At the end of current subscription peroid(after 5 minutes), it should't be auto-renewed?
but it become expired.
In the sandbox environment, auto renewable subscriptions are much shorter than the actual time. From this answer:
Actual duration Sandbox duration
1 week 3 minutes
1 month 5 minutes
2 months 10 minutes
3 months 15 minutes
6 months 30 minutes
1 year 1 hour
And although this fact is not documented, according to some developers in Apple's developer forum (and my own experience), subscription will renew 5 times before you get 21006 error (subscription expired error). So if you have a 1 month subscription, it will be renewed every 5 minutes for 25 minutes. Don't rely on this fact though, as it's not officially documented and might change anytime.
This is my experience as well. Auto-renewing in the sandbox environment is inconsistent. On some occasions I've seen a sandbox subscription auto-renew about 5 times before ending. But on other occasions it doesn't auto-renew at all. I assume these problems don't exist in the production environment.
I have experienced this as well, but if I kill the app from the multitasking tray (or stop the process in Xcode) and relaunch, I get an updated transaction with state "SKPaymentTransactionStatePurchased" that essentially renews the subscription. Check that out. It will at least give you something. Very frustrating that this is so inconsistent and not in alignment with the documentation.