I am using Pocket API and authenticating the user on the app.
While in the extension i want to use the logged in user to run methods to call various endpoints. The only option to share data between the app and its extension is NSUserDefaults as I see on various threads but NSUserDefaults cannot save NSObjects of logged in user.
How can I use the logged in user in the Extention ?
I am logging the user like this in the app..
[[PocketAPI sharedAPI] loginWithHandler: ^(PocketAPI *API, NSError *error){
if (error != nil)
{
NSlog (@"User Logged In");
}
}];
}
and in the extension i want to use :
[[PocketAPI sharedAPI] saveURL:url handler: ^(PocketAPI *API, NSURL *URL,
NSError *error){
if(error){
NSLog(@"There was an error in saving the URL : %@ ", [error description]);
}else{
NSLog(@"URL was saved successfully ");
}
}];
how do i dynamically save the [PocketAPI sharedAPI] to use any method on either side? How can i share the same instance of the object