Skip to content

Commit 2e5501e

Browse files
committed
Integrate Latest @ 201420902
Changes to auth/testapp ... - Expect linking with the same credential to error. Changes to dynamic_links/testapp ... - Remove the explicit firebase-core Android dependency. Changes to functions/testapp ... - Change the testapp to verify the result of addNumbers. Changes to invites/testapp ... - Remove the explicit firebase-core Android dependency. Changes to messaging/testapp ... - Add instructions to readme about enabling push notifications. CL: 201420902
1 parent e763e4f commit 2e5501e

File tree

5 files changed

+52
-4
lines changed

5 files changed

+52
-4
lines changed

auth/testapp/src/common_main.cc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,35 @@ extern "C" int common_main(int argc, const char* argv[]) {
716716
}
717717
}
718718

719+
// Test User::UpdateUserProfile
720+
{
721+
Future<User*> sign_in_future = auth->SignInWithEmailAndPassword(
722+
user_login.email(), user_login.password());
723+
WaitForSignInFuture(
724+
sign_in_future,
725+
"Auth::SignInWithEmailAndPassword() existing email and password",
726+
kAuthErrorNone, auth);
727+
if (sign_in_future.error() == kAuthErrorNone) {
728+
User* user = *sign_in_future.result();
729+
const char* kDisplayName = "Hello World";
730+
const char* kPhotoUrl = "http://test.com/image.jpg";
731+
User::UserProfile user_profile;
732+
user_profile.display_name = kDisplayName;
733+
user_profile.photo_url = kPhotoUrl;
734+
Future<void> update_profile_future =
735+
user->UpdateUserProfile(user_profile);
736+
WaitForFuture(update_profile_future, "User::UpdateUserProfile",
737+
kAuthErrorNone);
738+
if (update_profile_future.error() == kAuthErrorNone) {
739+
ExpectStringsEqual("User::display_name", kDisplayName,
740+
user->display_name().c_str());
741+
ExpectStringsEqual("User::photo_url", kPhotoUrl,
742+
user->photo_url().c_str());
743+
}
744+
}
745+
}
746+
747+
719748
// Sign in anonymously, link an email credential, reauthenticate with the
720749
// credential, unlink the credential and finally sign out.
721750
{

dynamic_links/testapp/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ android {
9191
}
9292

9393
dependencies {
94-
compile 'com.google.firebase:firebase-core:16.0.1'
9594
compile 'com.google.firebase:firebase-invites:16.0.0'
9695
compile 'com.google.firebase:firebase-common:16.0.0'
9796
}

functions/testapp/src/common_main.cc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,16 @@ extern "C" int common_main(int argc, const char* argv[]) {
128128
LogMessage(" Error %d: %s", future.error(), future.error_message());
129129
} else {
130130
firebase::Variant result = future.result()->data();
131-
int64_t op_result = result.map()["operationResult"].int64_value();
132-
LogMessage("Result: %d", op_result);
131+
int op_result =
132+
static_cast<int>(result.map()["operationResult"].int64_value());
133+
const int expected = 12;
134+
if (op_result != expected) {
135+
LogMessage("FAILED!");
136+
LogMessage(" Expected: %d, Actual: %d", expected, op_result);
137+
} else {
138+
LogMessage("SUCCESS.");
139+
LogMessage(" Got expected result: %d", op_result);
140+
}
133141
}
134142

135143
LogMessage("Shutting down the Functions library.");

invites/testapp/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ android {
9191
}
9292

9393
dependencies {
94-
compile 'com.google.firebase:firebase-core:16.0.1'
9594
compile 'com.google.firebase:firebase-invites:16.0.0'
9695
compile 'com.google.firebase:firebase-common:16.0.0'
9796
}

messaging/testapp/readme.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,19 @@ Building and Running the testapp
6666
[APNs](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html)
6767
certificate. If you don't already have one, see
6868
[Provisioning APNs SSL Certificates.](https://firebase.google.com/docs/cloud-messaging/ios/certs)
69+
- Configure the Xcode project for push messaging.
70+
- Select the `testapp` project from the `Navigator area`.
71+
- Select the `testapp` target from the `Editor area`.
72+
- Select the `General` tab from the `Editor area`.
73+
- Scroll down to `Linked Frameworks and Libraries` and click the `+`
74+
button to add a framework.
75+
- In the window that appears, scroll to `UserNotifications.framework`
76+
and click on that entry, then click on `Add`. This framework will only
77+
appear in Xcode version 8 and higher, required by this library.
78+
- Select the `Capabilities` tab from the `Editor area`.
79+
- Switch `Push Notifications` to `On`.
80+
- Scroll down to `Background Modes` and switch it to `On`.
81+
- Tick the `Remote notifications` box under `Background Modes`.
6982
- In XCode, build & run the sample on an iOS device or simulator.
7083
- The testapp has no user interface. The output of the app can be viewed
7184
via the console. In Xcode, select

0 commit comments

Comments
 (0)