Skip to content

Commit

Permalink
Updates for Android, use new Flutter registry
Browse files Browse the repository at this point in the history
  • Loading branch information
collinjackson committed May 5, 2017
1 parent f3c3009 commit 7bde905
Show file tree
Hide file tree
Showing 13 changed files with 155 additions and 159 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
public class FirebaseStoragePlugin implements MethodCallHandler {
private FlutterActivity activity;

public static void register(FlutterActivity activity) {
new FirebaseStoragePlugin(activity);
public static FirebaseStoragePlugin register(FlutterActivity activity) {
return new FirebaseStoragePlugin(activity);
}

private FirebaseStoragePlugin(FlutterActivity activity) {
Expand Down
4 changes: 3 additions & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ android {
}

defaultConfig {
applicationId 'com.yourcompany.firebase_storage'
applicationId 'io.flutter.plugins.firebase_storage_example'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

Expand All @@ -45,3 +45,5 @@ dependencies {
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
}

apply plugin: 'com.google.gms.google-services'
93 changes: 93 additions & 0 deletions example/android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"project_info": {
"project_number": "297855924061",
"firebase_url": "https://flutterfire-cd2f7.firebaseio.com",
"project_id": "flutterfire-cd2f7",
"storage_bucket": "flutterfire-cd2f7.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:297855924061:android:669871c998cc21bd",
"android_client_info": {
"package_name": "com.yourcompany.firebaseauth.example"
}
},
"oauth_client": [
{
"client_id": "297855924061-col4in4uubarifm60nbq8id01ec3ss4c.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.yourcompany.firebaseauth.example",
"certificate_hash": "8a4e194f5bfc3fb1075e7daae8dcddd526fde207"
}
},
{
"client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyD_shO5mfO9lhy2TVWhfo1VUmARKlG4suk"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "297855924061-48k2m6hl6pa4q9hukijjd0c20ev4qans.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.yourcompany.firebaseAuthExample"
}
},
{
"client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com",
"client_type": 3
}
]
},
"ads_service": {
"status": 2
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:297855924061:android:92efa9a0df6f077f",
"android_client_info": {
"package_name": "io.flutter.plugins.firebase_storage_example"
}
},
"oauth_client": [
{
"client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyD_shO5mfO9lhy2TVWhfo1VUmARKlG4suk"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
2 changes: 1 addition & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourcompany.firebase_storage_example"
package="io.flutter.plugins.firebase_storage_example"
android:versionCode="1"
android:versionName="0.0.1">

Expand Down
144 changes: 0 additions & 144 deletions example/android/app/src/main/google-services.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.yourcompany.firebase_storage_example;
package io.flutter.plugins.firebase_storage_example;

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
Expand Down
1 change: 1 addition & 0 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ buildscript {

dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}

Expand Down
1 change: 1 addition & 0 deletions example/ios/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ xcuserdata
Icon?
.tags*

Pods/
/Flutter/app.flx
/Flutter/app.zip
/Flutter/App.framework
Expand Down
14 changes: 10 additions & 4 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
7A1ECC911E8EDB6900309407 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7A1ECC901E8EDB6900309407 /* GoogleService-Info.plist */; };
7AF116271EBD2AD800AD0206 /* PluginRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AF116251EBD2AD800AD0206 /* PluginRegistry.m */; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
Expand All @@ -21,7 +22,7 @@
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
B1F3D14E8117A6C9F65810E0 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D558BB7489B1C82B42A9097 /* libPods-Runner.a */; };
CE57DC9C9240FBD15E358E24 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E13AAF33B0B411D7B2D38642 /* libPods-Runner.a */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -42,8 +43,9 @@
/* Begin PBXFileReference section */
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
4D558BB7489B1C82B42A9097 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
7A1ECC901E8EDB6900309407 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
7AF116251EBD2AD800AD0206 /* PluginRegistry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PluginRegistry.m; sourceTree = "<group>"; };
7AF116261EBD2AD800AD0206 /* PluginRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginRegistry.h; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
Expand All @@ -57,6 +59,7 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E13AAF33B0B411D7B2D38642 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -66,7 +69,7 @@
files = (
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
B1F3D14E8117A6C9F65810E0 /* libPods-Runner.a in Frameworks */,
CE57DC9C9240FBD15E358E24 /* libPods-Runner.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -116,6 +119,8 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
7AF116251EBD2AD800AD0206 /* PluginRegistry.m */,
7AF116261EBD2AD800AD0206 /* PluginRegistry.h */,
7A1ECC901E8EDB6900309407 /* GoogleService-Info.plist */,
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
Expand All @@ -139,7 +144,7 @@
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */ = {
isa = PBXGroup;
children = (
4D558BB7489B1C82B42A9097 /* libPods-Runner.a */,
E13AAF33B0B411D7B2D38642 /* libPods-Runner.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -303,6 +308,7 @@
files = (
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
97C146F31CF9000F007C117D /* main.m in Sources */,
7AF116271EBD2AD800AD0206 /* PluginRegistry.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
11 changes: 6 additions & 5 deletions example/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#include "AppDelegate.h"
#include "FirebaseStoragePlugin.h"
#include "PluginRegistry.h"

@implementation AppDelegate {
FirebaseStoragePlugin *_firebase_storage;
PluginRegistry *plugins;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
FlutterViewController *flutterController =
(FlutterViewController *)self.window.rootViewController;
_firebase_storage = [[FirebaseStoragePlugin alloc] initWithController:flutterController];
return YES;
plugins = [[PluginRegistry alloc] initWithController:flutterController];
return YES;
}

@end

0 comments on commit 7bde905

Please sign in to comment.