Skip to content

Commit cd92f76

Browse files
author
Stewart Miles
committed
Integrate Latest @ 125342854
Changes to admob/testapp ... - Updated the version numbers in the Firebase Test Apps to 9.0.2. Also updatedthe Gradle plugin version. - Set the default compiler for Android samples to Clang. CL: 125342854
1 parent 8d6ae38 commit cd92f76

File tree

12 files changed

+76
-23
lines changed

12 files changed

+76
-23
lines changed

admob/testapp/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.0.0'
8+
classpath 'com.android.tools.build:gradle:2.1.2'
99
classpath 'com.google.gms:google-services:3.0.0'
1010
}
1111
}
@@ -59,7 +59,7 @@ project.ext {
5959

6060
android {
6161
compileSdkVersion 23
62-
buildToolsVersion '23.0.2'
62+
buildToolsVersion '23.0.3'
6363

6464
sourceSets {
6565
main {
@@ -89,7 +89,7 @@ android {
8989

9090
dependencies {
9191
compile fileTree(dir: 'libs', include: ['*.jar'])
92-
compile 'com.google.android.gms:play-services-ads:9.0.0'
92+
compile 'com.google.android.gms:play-services-ads:9.0.2'
9393
}
9494

9595
apply plugin: 'com.google.gms.google-services'

admob/testapp/src/common_main.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ extern "C" int common_main(int argc, const char* argv[]) {
104104
app = ::firebase::App::Create(::firebase::AppOptions());
105105
#endif // defined(__ANDROID__)
106106

107+
if (app == nullptr) {
108+
LogMessage("Couldn't create firebase app, aborting.");
109+
// Wait until the user wants to quit the app.
110+
while (!ProcessEvents(1000)) {
111+
}
112+
return 1;
113+
}
114+
107115
LogMessage("Created the Firebase App %x.",
108116
static_cast<int>(reinterpret_cast<intptr_t>(app)));
109117

analytics/testapp/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.0.0'
8+
classpath 'com.android.tools.build:gradle:2.1.2'
99
classpath 'com.google.gms:google-services:3.0.0'
1010
}
1111
}
@@ -59,7 +59,7 @@ project.ext {
5959

6060
android {
6161
compileSdkVersion 23
62-
buildToolsVersion '23.0.2'
62+
buildToolsVersion '23.0.3'
6363

6464
sourceSets {
6565
main {
@@ -90,7 +90,7 @@ android {
9090

9191
dependencies {
9292
compile fileTree(dir: 'libs', include: ['*.jar'])
93-
compile 'com.google.firebase:firebase-analytics:9.0.0'
93+
compile 'com.google.firebase:firebase-analytics:9.0.2'
9494
}
9595

9696
apply plugin: 'com.google.gms.google-services'

analytics/testapp/src/common_main.cc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,21 @@ extern "C" int common_main(int argc, const char* argv[]) {
2727
::firebase::App* app;
2828

2929
LogMessage("Initialize the Analytics library");
30+
do {
3031
#if defined(__ANDROID__)
31-
app = ::firebase::App::Create(::firebase::AppOptions(), GetJniEnv(),
32-
GetActivity());
32+
app = ::firebase::App::Create(::firebase::AppOptions(), GetJniEnv(),
33+
GetActivity());
3334
#else
34-
app = ::firebase::App::Create(::firebase::AppOptions());
35+
app = ::firebase::App::Create(::firebase::AppOptions());
3536
#endif // defined(__ANDROID__)
3637

38+
if (app == nullptr) {
39+
LogMessage("Couldn't create firebase app, try again.");
40+
// Wait a few moments, and try to create app again.
41+
ProcessEvents(1000);
42+
}
43+
} while (app == nullptr);
44+
3745
LogMessage("Created the firebase app %x",
3846
static_cast<int>(reinterpret_cast<intptr_t>(app)));
3947
analytics::Initialize(*app);

auth/testapp/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.0.0'
8+
classpath 'com.android.tools.build:gradle:2.1.2'
99
classpath 'com.google.gms:google-services:3.0.0'
1010
}
1111
}
@@ -59,7 +59,7 @@ project.ext {
5959

6060
android {
6161
compileSdkVersion 23
62-
buildToolsVersion '23.0.2'
62+
buildToolsVersion '23.0.3'
6363

6464
sourceSets {
6565
main {
@@ -90,7 +90,7 @@ android {
9090

9191
dependencies {
9292
compile fileTree(dir: 'libs', include: ['*.jar'])
93-
compile 'com.google.firebase:firebase-auth:9.0.0'
93+
compile 'com.google.firebase:firebase-auth:9.0.2'
9494

9595
}
9696

auth/testapp/src/common_main.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class UserLogin {
204204
user_ = nullptr;
205205
}
206206

207-
const char* email() const { return email_.c_str(); }
207+
const char* email() const { return email_.c_str(); }
208208
const char* password() const { return password_.c_str(); }
209209
User* user() const { return user_; }
210210
void set_email(const char* email) { email_ = email; }
@@ -228,6 +228,15 @@ extern "C" int common_main(int argc, const char* argv[]) {
228228
#else
229229
app = App::Create(AppOptions());
230230
#endif // defined(__ANDROID__)
231+
232+
if (app == nullptr) {
233+
LogMessage("Couldn't create firebase app, aborting.");
234+
// Wait until the user wants to quit the app.
235+
while (!ProcessEvents(1000)) {
236+
}
237+
return 1;
238+
}
239+
231240
LogMessage("Created the Firebase app %x.",
232241
static_cast<int>(reinterpret_cast<intptr_t>(app)));
233242
// Create the Auth class for that App.

invites/testapp/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.0.0'
9-
classpath 'com.google.gms:google-services:3.0.0'
8+
classpath 'com.android.tools.build:gradle:2.1.2'
9+
classpath 'com.google.gms:google-services:3.0.0'
1010
}
1111
}
1212

@@ -59,7 +59,7 @@ project.ext {
5959

6060
android {
6161
compileSdkVersion 23
62-
buildToolsVersion '23.0.2'
62+
buildToolsVersion '23.0.3'
6363

6464
sourceSets {
6565
main {
@@ -90,7 +90,7 @@ android {
9090

9191
dependencies {
9292
compile fileTree(dir: 'libs', include: ['*.jar'])
93-
compile 'com.google.firebase:firebase-invites:9.0.0'
93+
compile 'com.google.firebase:firebase-invites:9.0.2'
9494
}
9595

9696
apply plugin: 'com.google.gms.google-services'

invites/testapp/src/common_main.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ extern "C" int common_main(int argc, const char* argv[]) {
3434
app = ::firebase::App::Create(::firebase::AppOptions());
3535
#endif // defined(__ANDROID__)
3636

37+
if (app == nullptr) {
38+
LogMessage("Couldn't create firebase app, aborting.");
39+
// Wait until the user wants to quit the app.
40+
while (!ProcessEvents(1000)) {
41+
}
42+
return 1;
43+
}
44+
3745
LogMessage("Created the Firebase App %x",
3846
static_cast<int>(reinterpret_cast<intptr_t>(app)));
3947

messaging/testapp/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.0.0'
8+
classpath 'com.android.tools.build:gradle:2.1.2'
99
classpath 'com.google.gms:google-services:3.0.0'
1010
}
1111
}
@@ -59,7 +59,7 @@ project.ext {
5959

6060
android {
6161
compileSdkVersion 23
62-
buildToolsVersion '23.0.2'
62+
buildToolsVersion '23.0.3'
6363

6464
sourceSets {
6565
main {
@@ -90,7 +90,7 @@ android {
9090

9191
dependencies {
9292
compile fileTree(dir: 'libs', include: ['*.jar'])
93-
compile 'com.google.firebase:firebase-messaging:9.0.0'
93+
compile 'com.google.firebase:firebase-messaging:9.0.2'
9494
}
9595

9696
apply plugin: 'com.google.gms.google-services'

messaging/testapp/src/common_main.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ class MessageListener : public firebase::messaging::Listener {
2626
// this OnMessage function is called once for each queued message.
2727
LogMessage("Recieved a new message");
2828
if (!message.from.empty()) LogMessage("from: %s", message.from.c_str());
29+
if (!message.error.empty()) LogMessage("error: %s", message.error.c_str());
30+
if (!message.message_id.empty()) {
31+
LogMessage("message_id: %s", message.message_id.c_str());
32+
}
2933
if (!message.data.empty()) {
3034
LogMessage("data:");
3135
typedef std::map<std::string, std::string>::const_iterator MapIter;
@@ -61,6 +65,14 @@ extern "C" int common_main(int argc, const char* argv[]) {
6165
app = ::firebase::App::Create(::firebase::AppOptions());
6266
#endif // defined(__ANDROID__)
6367

68+
if (app == nullptr) {
69+
LogMessage("Couldn't create firebase app, aborting.");
70+
// Wait until the user wants to quit the app.
71+
while (!ProcessEvents(1000)) {
72+
}
73+
return 1;
74+
}
75+
6476
LogMessage("Initialized Firebase App.");
6577

6678
::firebase::messaging::Initialize(*app, &g_listener);

0 commit comments

Comments
 (0)