Cache on iOS, How to delete on relauch - iphone

I decided to import this project on my app i found on github lockscreen. Essentially it works just like the iOS pincode lockscreen but in this case it protects the app from being used a random snoopy person. The lockscreen works my issue is if in case I had set a passcode lock pin and delete the app off my iPhone and reinstall it the lockscreen still askes for to enter a pincode. I believe this is being caused form a cache storing the set pin codes for the app. Is the a way to delete the cache at relaunch or in the event of deleting the app ? I suppose this would be implemented in the delegate? How could you do this

Well yes and no. The passkey is stored in the keychain, from which you will need to remove it.
The way to do that is to check on startup that it is a new install of the app and clear the current value of the passkey form the keychain.
Since there is not code executed on the removal of you app you can't really do it after or when the app is removed.

Related

How can i come to know app is not installed first time on a device iPhone

I want to store some value when app is installed first time.
So when user delete and re install that app . read that value and take actions accordingly.
Is there any way ?
Scenario:
App installed first time store value somewhere.
User deletes app from iPhone.
Re install app again.
Read that stored value. ?
Is this possible ?
To achieve what you want, You can directly refer Keychain Data from Apple Documentation.
use the Keychain to store your data, because the Keychain items are not deleted even if the app is Uninstalled or removed.
This Api will help a lot Link, have a look

Reset push notification permission setting in ios5

I am developing an app that uses push notifications, and testing on a device with iOS 5.1.1. I would like to test the scenario where the user is prompted about push notifications during the app's first run. The dialog appears the first time I call registerForRemoteNotificationTypes, but never appears again, even if the app is re-installed from scratch. How can I clear the setting so that the dialog will appear again?
The same question was posted before, but the answers do not work for iOS 5 or later, as noted in the comments there.
Apple's documentation says to uninstall the app and mess with the clock to make it look like the app was uninstalled for a day, but this does not work on iOS5.
Another answer suggested running General -> Reset -> Erase All Content And Settings - I tried this, but it froze my device and I ended up having to power-cycle it. In any case, this is a heavy-handed solution that is not practical for testing.
Another answer suggested removing your app's entry from /private/var/mobile/Library/RemoteNotification/Clients.plist, but this file does not exist on iOS5.
Is there a way to accomplish this on iOS5?
I found a solution that works if your device is jailbroken:
Use an app like iFile to open the file /var/mobile/Library/SpringBoard/applicationstate.plist with a property list viewer
Find your app's bundle identifier and delete the key SBRemoteNotificationClient
Restart SpringBoard - either reboot the device, SSH to the device and run killall SpringBoard, or use the Respring app.
Next time you run your app, it will show the notification permission dialog once again.
I've tested this on iOS 5.1.1.
Provided your code paths for iOS 5 and iOS 6 aren't too different, the easiest option is probably to just test that specific behaviour on iOS 6 — the callbacks you get on iOS 5 should be similar enough for it not to be an issue.
Alternatively, change the app's bundle ID. Slightly tedious (in the past I've needed to restart Xcode for it to notice that change in bundle ID), and you'll need a wildcard provisioning profile handy.

Is there any even function that occurs in the case of deleting the app?

The iPhone app i developed save user data (id, pw) to keychain of iOS by using open source SFHFKeychainUtils
Problem is that the id,pw data still remains intact upon deleting the app,
which cause trouble when reinstalling the app.
Would it be possible to delete the id, pw in the keychaing along with the app?
Is there any even function that occurs in the case of deleting the app?
No, your app does not get notified of its deletion. AFAIK, the OS keeps the keychain data for some time (a few days or so) and then deletes it automatically.

auto upgrading iOS apps

Is there some way to implement an auto-upgrade for an iPad app.
I would like to be able to have my app check for updates, and then upgrade itself.
As far as I am concerned the app can retrieve the update from the app-store, but:
I would like the interface to be app internal: User should just have to press an OK button for the upgrade to start (all this time staying within the app)
Is this possible at all?
It is possible to have display a notification to inform an update is available on you app and you can redirect the user to the AppStore, but an update can only be download from the AppStore.
This will reinstall the new version of your app. So you can't stay in the app to update (You need to go to the appStore and qui the app during the update).
Internally, you can only update some content for you app (not add new native code) but not with a real AppStore update.
Apple does not allow apps to download, install, or execute code that is not included in the original app submitted to Apple. The App store upgrade cannot be automatically started.
the best you can do is determine if the app store has a newer update, then prompt the user to install it by linking directly to the app page in the app store. They will still have to click the correct buttons to start the process.
Even if it were possible, it's not allowed by Apple. Your app will be rejected.
Unless you only update contents of your app, e.g. cooking receipts.

iphone keychain items persist after application uninstall?

I am playing with idandersen's scifihifi-iphone code for keychain and came across the following behavior - I set the password using, say
[SFHFKeychainUtils storeUsername:#"User" andPassword:#"123"
forServiceName:#"TestService" updateExisting:YES error:&error];
Then delete test application from device and install it again - the previously set password appears to remain in keychain...
Is it the expected behavior? And is there a way to make sure that password I set will be deleted with the application?
Yes, this is the expected and correct behavior.
Some keychain items may be shared with other apps you control (that share the same keychain item access group).
You should just leave the info alone when your app is removed. You have no callback or method of removing the keychain items on deletion of your app.
Edit:
They finally reverted the behavior described in my answers, so until everybody move away from that range of versions, this should not happen anymore.
Unfortunately, this is not the case anymore. It has been changed since iOS 10.3.
This is an intentional change in iOS 10.3 to protect user privacy. Information that can identify a user should not be left on the device after the app that created it has been removed.
It has never been a part of the API contract that keychain items
created by an app would survive when the app is removed. This has
always been an implementation detail.
See the reference here.