Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share Extension - [PFUser currentUser] is nil #565

Closed
seecahkhing opened this issue Feb 22, 2016 · 2 comments
Closed

Share Extension - [PFUser currentUser] is nil #565

seecahkhing opened this issue Feb 22, 2016 · 2 comments

Comments

@seecahkhing
Copy link

Hi,

I've tested the previously working Share Extension (using Parse platform) after I migrated to Parse-server. The main/container app is working fine with queries and is still configured as follows:
[Parse enableDataSharingWithApplicationGroupIdentifier:AppGroupId];
[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock..

So on my share extension I'm still using the same initialization as well except [Parse setApplicationId.. which is changed to Parse initializeWithConfiguration,

[Parse enableDataSharingWithApplicationGroupIdentifier:AppGroupId containingApplication:AppGroupId]; [Parse enableLocalDatastore];
before I set the Parse initializeWithConfiguration...

On the share extension, the [PFUser currentUser] is always nil..

Kindly advise if there are some tweaks need to be done.. Thanks in advance..

@nlutsenko
Copy link
Contributor

Hey @seecahkhing, initializeWithConfiguration: changes everything 😛
Now to enable data sharing - you would need to do something like this:

[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> configuration) {
  configuration.applicationId = ...;
  configuration.clientKey = ...;
  configuration.localDatastoreEnabled = YES;
  configuration.applicationGroupIdentifier = AppGroupId;
  configuration.containingApplicationBundleIdentifier = AppGroupId; // This goes only in extension
 }];

Which means that any configuration applied directly via Parse class if you use initializeWithConfiguration: is ignored and is superseded by the configuration provided in an object.
Hope this helps, feel free to reopen this issue if it doesn't.

@nlutsenko nlutsenko self-assigned this Feb 22, 2016
@rs-ng-thai
Copy link

@nlutsenko
Can you please explain how to import parse library to share extension?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants