File tree Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,8 @@ TEST_F(FirebaseMessagingTest, TestReceiveToken) {
354
354
355
355
EXPECT_TRUE (RequestPermission ());
356
356
357
+ EXPECT_TRUE (::firebase::messaging::IsTokenRegistrationOnInitEnabled ());
358
+
357
359
FLAKY_TEST_SECTION_BEGIN ();
358
360
359
361
EXPECT_TRUE (WaitForToken ());
Original file line number Diff line number Diff line change @@ -713,21 +713,13 @@ void Terminate() {
713
713
static void InstallationsGetToken () {
714
714
FIREBASE_ASSERT_MESSAGE_RETURN_VOID (internal::IsInitialized (),
715
715
kMessagingNotInitializedError );
716
- JNIEnv* env = g_app->GetJNIEnv ();
717
-
718
- // Intent intent = new Intent(this, RegistrationIntentService.class);
719
- jobject new_intent = env->NewObject (
720
- util::intent::GetClass (),
721
- util::intent::GetMethodId (util::intent::kConstructor ), g_app->activity (),
722
- registration_intent_service::GetClass ());
716
+ Future<std::string> result = GetToken ();
723
717
724
- // startService(intent);
725
- jobject component_name = env->CallObjectMethod (
726
- g_app->activity (),
727
- util::context::GetMethodId (util::context::kStartService ), new_intent);
728
- assert (env->ExceptionCheck () == false );
729
- env->DeleteLocalRef (component_name);
730
- env->DeleteLocalRef (new_intent);
718
+ result.OnCompletion (
719
+ [](const Future<std::string>& result, void * voidptr) {
720
+ NotifyListenerOnTokenReceived (result.result ()->c_str ());
721
+ },
722
+ nullptr );
731
723
}
732
724
733
725
static void SubscriptionUpdateComplete (JNIEnv* env, jobject result,
Original file line number Diff line number Diff line change @@ -567,10 +567,16 @@ code.
567
567
568
568
## Release Notes
569
569
570
+ ### Future Release
571
+ - Changes
572
+ - Messaging (Android): Fixes an issue to receive token when
573
+ initialize the app.
574
+ ([ #667 ] ( https://github.com/firebase/firebase-cpp-sdk/pull/667 ) ).
575
+
570
576
### 8.5.0
571
577
- Changes
572
578
- General: Updating Android and iOS dependencies to the latest.
573
- - General: Fix the generating of proguard file
579
+ - General: Fixes an issue with generating Proguard files.
574
580
([ #664 ] ( https://github.com/firebase/firebase-cpp-sdk/pull/664 ) ).
575
581
576
582
### 8.4.0
You can’t perform that action at this time.
0 commit comments