Skip to content

Conversation

elvishew
Copy link

When I am using Parse push notification, I found I always could not receive any push notification if I am using Huawei phones, and finally I found out that the Huawei phone has google service framework, so Parse would choose GCM as push type, but unfortunately, there is no Play Store in the phone, and somehow when Parse try to register the GCM push, it always got GSF_PACKAGE_NOT_AVAILABLE error, so the push notification won't work at all, but if I install Play Store on the phone, the GCM works.
I don't know whether this is a bug of Huawei's OS, or a bug of Parse, I just fix it. If we can not find the GCM register service, we regard the phone as GCM register unavailable.
With this fix, even there is no Play Store installed in Huawei phones, the push can work in a PPNS mode.

@facebook-github-bot
Copy link

By analyzing the blame information on this pull request, we identified @grantland to be a potential reviewer.

intent.setPackage("com.google.android.gsf");
List<ResolveInfo> services = getContext().getPackageManager().queryIntentServices(intent, 0);
return services != null && services.size() > 0;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move this method into GcmRegistrar

@grantland
Copy link
Contributor

With this change, we shouldn't need isGooglePlayServicesAvailable(), right?

@facebook-github-bot
Copy link

@elvishew updated the pull request.

@facebook-github-bot
Copy link

@elvishew updated the pull request.

@grantland
Copy link
Contributor

I'm not too familiar with this code, @bnham would you have any insight into this?

}

private static boolean isGooglePlayServicesAvailable() {
return Build.VERSION.SDK_INT >= 8 && getPackageInfo("com.google.android.gsf") != null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we simplify this PR by deleting these two lines here and replacing it with the code you wrote for isGcmRegisterServiceAvailable?

@bnham
Copy link

bnham commented May 31, 2016

This looks good, but let's try to minimize the amount of code changed. Can you change your diff so that it just deletes the body of isGooglePlayServicesAvailable and replaces it with the body of isGcmRegisterServiceAvailable? Then you wouldn't need to change all of those other lines of code.

@ghost
Copy link

ghost commented Aug 3, 2016

@elvishew updated the pull request.

@ghost ghost added the CLA Signed label Aug 3, 2016
@ghost
Copy link

ghost commented Aug 4, 2016

@elvishew updated the pull request.

@rogerhu
Copy link
Contributor

rogerhu commented Mar 9, 2017

Do we still need this PR?

@lacker lacker unassigned bnham Apr 5, 2017
@Jawnnypoo
Copy link
Member

This PR is very out of date, if OP wants to redo it, feel free. Going to close this one though

@Jawnnypoo Jawnnypoo closed this Sep 26, 2017
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

Successfully merging this pull request may close these issues.

6 participants