forked from firebase/flutterfire
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[firebase_core] set user agent (firebase#1582)
* Send Android user agent to Firebase
- Loading branch information
1 parent
9eaf22b
commit c3afcab
Showing
8 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.4.0+1 | ||
|
||
* Send user agent to Firebase. | ||
|
||
## 0.4.0 | ||
|
||
* Update Android dependencies to latest. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="io.flutter.plugins.firebase.core"> | ||
<application> | ||
<service android:name="com.google.firebase.components.ComponentDiscoveryService"> | ||
<meta-data android:name="com.google.firebase.components:io.flutter.plugins.firebase.core.FlutterFirebaseAppRegistrar" | ||
android:value="com.google.firebase.components.ComponentRegistrar" /> | ||
</service> | ||
</application> | ||
</manifest> |
18 changes: 18 additions & 0 deletions
18
...e/android/src/main/java/io/flutter/plugins/firebase/core/FlutterFirebaseAppRegistrar.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.flutter.plugins.firebase.core; | ||
|
||
import com.google.firebase.components.Component; | ||
import com.google.firebase.components.ComponentRegistrar; | ||
import com.google.firebase.platforminfo.LibraryVersionComponent; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class FlutterFirebaseAppRegistrar implements ComponentRegistrar { | ||
private static final String LIBRARY_NAME = "flutter-firebase_core"; | ||
private static final String LIBRARY_VERSION = "0.4.0+1"; | ||
|
||
@Override | ||
public List<Component<?>> getComponents() { | ||
return Collections.<Component<?>>singletonList( | ||
LibraryVersionComponent.create(LIBRARY_NAME, LIBRARY_VERSION)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Core, enabling connecting to multiple | |
Firebase apps. | ||
author: Flutter Team <[email protected]> | ||
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_core | ||
version: 0.4.0 | ||
version: 0.4.0+1 | ||
|
||
flutter: | ||
plugin: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# This script checks to make sure that if LIBRARY_VERSION is hard coded, it is set | ||
# to match the version in pubspec.yaml. This allows plugins to report their version | ||
# for analytics purposes. See https://github.com/flutter/flutter/issues/32267 | ||
|
||
# So that users can run this script from anywhere and it will work as expected. | ||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" | ||
REPO_DIR="$(dirname "$SCRIPT_DIR")" | ||
|
||
source "$SCRIPT_DIR/common.sh" | ||
|
||
function check_hard_coded_version() { | ||
local failures=() | ||
for package_name in "$@"; do | ||
local dir="$REPO_DIR/packages/$package_name" | ||
echo "Checking that $package_name has the correct hard coded version, if any." | ||
PACKAGE_VERSION="$(cd "$dir" && cat pubspec.yaml | grep -E "^version: " | awk '{print $2}')" | ||
IOS_VERSION="$(cd "$dir" && grep -r "#define LIBRARY_VERSION" ios/Classes/*.m | awk '{print $3}')" | ||
ANDROID_VERSION="$(cd "$dir" && grep -r LIBRARY_VERSION android/src/main/java/* | awk '{print $8}')" | ||
if [[ "$IOS_VERSION" == 0 && "$ANDROID_VERSION" == 0 ]]; then | ||
echo "No hard coded version found" | ||
elif [[ "$IOS_VERSION" == "@\"$PACKAGE_VERSION\"" && "$ANDROID_VERSION" == "\"$PACKAGE_VERSION\";" ]]; then | ||
echo "Hard coded version matched: $PACKAGE_VERSION" | ||
else | ||
error "Hard coded version check failed for $package_name" | ||
error "pubspec.yaml version: $PACKAGE_VERSION" | ||
error "Android version: $ANDROID_VERSION" | ||
error "iOS version: $IOS_VERSION" | ||
failures=("${failures[@]}" "$package_name") | ||
fi | ||
done | ||
if [[ "${#failures[@]}" != 0 ]]; then | ||
error "FAIL: The following ${#failures[@]} package(s) failed the hard coded version check:" | ||
for failure in "${failures[@]}"; do | ||
error "$failure" | ||
done | ||
fi | ||
return "${#failures[@]}" | ||
} | ||
|
||
# Sets CHANGED_PACKAGE_LIST | ||
check_changed_packages | ||
|
||
if [[ "${#CHANGED_PACKAGE_LIST[@]}" != 0 ]]; then | ||
check_hard_coded_version "${CHANGED_PACKAGE_LIST[@]}" | ||
fi |