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

Migrate sample from GCM to FCM #87

Merged
merged 6 commits into from
Apr 5, 2019
Merged

Migrate sample from GCM to FCM #87

merged 6 commits into from
Apr 5, 2019

Conversation

lbalmaceda
Copy link
Contributor

Followed this migration guide.

Sample app won't run unless a valid google-services.json file is present on the app's module root.

@@ -123,17 +122,17 @@ private void createCameraSource(boolean autoFocus, boolean useFlash) {
.setFacing(CameraSource.CAMERA_FACING_BACK)
.setRequestedPreviewSize(1024, 600)
.setRequestedFps(15.0f)
.setFocusMode(autoFocus ? Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE : null);
.setFocusMode(true ? Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE : null);

Choose a reason for hiding this comment

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

We can remove the conditionals.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. Left this to linter auto-fix.

@@ -63,21 +63,23 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:textIsSelectable="true"

Choose a reason for hiding this comment

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

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This only affects the sample app. It makes the text selectable so one can easily copy the device name / fcm token and use it on the firebase console to send test fcm notifications . No cosmetic change.

@@ -224,12 +224,12 @@ private String createJWT(@NonNull PrivateKey privateKey,
String headerAndPayload = base64UrlSafeEncode(gson.toJson(headers).getBytes())
+ "." + base64UrlSafeEncode(gson.toJson(claims).getBytes());
final byte[] messageBytes = headerAndPayload.getBytes();
final Signature signer = Signature.getInstance("SHA256withRSA", "BC");
final Signature signer = Signature.getInstance("SHA256withRSA");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Caused by: java.security.NoSuchAlgorithmException: The BC provider no longer provides an implementation for Signature.SHA256withRSA.  

Please see https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html for more details.

@lbalmaceda lbalmaceda added this to the 0.4.0 milestone Apr 5, 2019
@lbalmaceda lbalmaceda merged commit 1ac2956 into master Apr 5, 2019
@lbalmaceda lbalmaceda deleted the update-sample branch April 5, 2019 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants