I want to delete an existing email account which has been registered in the device through code. The basic idea I got after going through some forums is to use private API's(like accountSettings) to handle these actions, but the deletion operation is not getting reflected in the device, though the reference is getting deleted in the app. Can anyone suggest me how to proceed with this?
Asked
Active
Viewed 339 times
1 Answers
0
There is a private framework called AccountsSettings.
It has some interesting classes (as example AccountsManager). It has method called "deleteAccount" and "deleteAccountWithIdentifier".
I am not sure whether they will work (they may be protected by entitlement). However, you can give it a try.
BTW. You can grab it's headers from here: https://github.com/masbog/PrivateFrameworkHeader-iOS-iPhone-5.-/blob/master/AccountSettings.framework/AccountsManager.h

Victor Ronin
- 22,758
- 18
- 92
- 184
-
Thanks for ur response.As i have mentioned in my question, I tried accountSettings framework wherein, when i call the "deleteAccount" method the reference is getting deleted in the application but its not reflected in the device.So you got any other idea?? – Vinayak Nov 19 '12 at 05:55
-
Sorry. Somehow I missed that you looked at accountSettings framework. The only other idea which I have it to try to use GSEvent to navigate to Preferences and delete some account. However, it will be complex. You can search here questions on simulation of system wide events for iOS and GSEvent (there are couple of them). – Victor Ronin Nov 19 '12 at 18:03