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

[WIP] feat: add stings-google-services dependency for APISENSE #58

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bee/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ dependencies {
implementation 'io.apisense.sdk:stings-motion:' + apisenseVersion
implementation 'io.apisense.sdk:stings-environment:' + apisenseVersion
implementation 'io.apisense.sdk:stings-visualization:' + apisenseVersion
implementation 'io.apisense.sdk:stings-google-services:' + apisenseVersion

experimentalImplementation('io.apisense:netsense:1.0.0')

Expand Down
3 changes: 3 additions & 0 deletions bee/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
# Dagger: https://github.com/google/dagger/issues/645
-dontwarn com.google.errorprone.annotations.*

# Places sting
-keepclassmembers class com.google.android.gms.location.places.Place { *; }

# End apisense
##############

Expand Down
4 changes: 4 additions & 0 deletions bee/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_places_api_key" />

<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>
Expand Down
14 changes: 8 additions & 6 deletions bee/src/main/java/com/apisense/bee/BeeApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.apisense.sdk.APISENSE;
import io.apisense.sdk.APSApplication;
import io.apisense.sting.environment.EnvironmentStingModule;
import io.apisense.sting.googleservices.GoogleServicesStingModule;
import io.apisense.sting.motion.MotionStingModule;
import io.apisense.sting.network.NetworkStingModule;
import io.apisense.sting.phone.PhoneStingModule;
Expand All @@ -45,11 +46,11 @@ public class BeeApplication extends APSApplication {
deviceMap.put("os", Build.VERSION.BASE_OS);
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Sender sender = new SyncSender.Builder().accessToken(BuildConfig.ROLLBAR_KEY).build();
// Rollbar doesn't seems to upload errors with only a SyncSender.
Sender buffSender = new BufferedSender.Builder().sender(sender).build();
rollbar = Rollbar.init(
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Sender sender = new SyncSender.Builder().accessToken(BuildConfig.ROLLBAR_KEY).build();
// Rollbar doesn't seems to upload errors with only a SyncSender.
Sender buffSender = new BufferedSender.Builder().sender(sender).build();
rollbar = Rollbar.init(
ConfigBuilder.withAccessToken(BuildConfig.ROLLBAR_KEY)
.environment(BuildConfig.ROLLBAR_ENV)
.framework("Android")
Expand Down Expand Up @@ -87,7 +88,8 @@ protected APISENSE.Sdk generateAPISENSESdk() {
new NetworkStingModule(),
new MotionStingModule(),
new EnvironmentStingModule(),
new VisualizationStingModule()
new VisualizationStingModule(),
new GoogleServicesStingModule()
)
.useScriptExecutionService(true);

Expand Down
1 change: 1 addition & 0 deletions bee/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<string translatable="false" name="google_web_client_id" >380173086743-qasd4ru2o2jnblbugg6vkj2em6d2uih1.apps.googleusercontent.com</string>
<string translatable="false" name="facebook_app_id">1760322360873183</string>
<string translatable="false" name="fb_login_protocol_scheme">fb1760322360873183</string>
<string translatable="false" name="google_places_api_key">AIzaSyBrZsS2athB3s4LGWpQdxh7yvSYHI5R3NI</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it ok to have the API key visible to everyone?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The key is protected in use by package signature on Google side, so the risk is minimal. But I can hide it if you prefer ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

Okey all good. 👍
It was just to be sure that no leak can appear :).


<string translatable="false" name="achievement_new_bee">CgkIl-DToIgLEAIQAQ</string>
<string translatable="false" name="achievement_join_the_swarm">CgkIl-DToIgLEAIQBg</string>
Expand Down