mirror of
https://github.com/farcasclaudiu/flutter_plugin_appcenter.git
synced 2026-06-22 09:01:31 +03:00
Initial version.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
# Uncomment this line to define a global platform for your project
|
||||
# platform :ios, '9.0'
|
||||
|
||||
if ENV['FLUTTER_FRAMEWORK_DIR'] == nil
|
||||
abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework')
|
||||
end
|
||||
|
||||
target 'Runner' do
|
||||
# Pods for Runner
|
||||
|
||||
# Flutter Pods
|
||||
pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR']
|
||||
|
||||
if File.exists? '../.flutter-plugins'
|
||||
flutter_root = File.expand_path('..')
|
||||
File.foreach('../.flutter-plugins') { |line|
|
||||
plugin = line.split(pattern='=')
|
||||
if plugin.length == 2
|
||||
name = plugin[0].strip()
|
||||
path = plugin[1].strip()
|
||||
resolved_path = File.expand_path("#{path}/ios", flutter_root)
|
||||
pod name, :path => resolved_path
|
||||
else
|
||||
puts "Invalid plugin specification: #{line}"
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
post_install do |installer|
|
||||
installer.pods_project.targets.each do |target|
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['ENABLE_BITCODE'] = 'NO'
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,46 @@
|
||||
PODS:
|
||||
- appcenter (0.0.1):
|
||||
- AppCenter
|
||||
- Flutter
|
||||
- AppCenter (1.0.1):
|
||||
- AppCenter/Analytics (= 1.0.1)
|
||||
- AppCenter/Crashes (= 1.0.1)
|
||||
- AppCenter/Analytics (1.0.1):
|
||||
- AppCenter/Core
|
||||
- AppCenter/Core (1.0.1)
|
||||
- AppCenter/Crashes (1.0.1):
|
||||
- AppCenter/Core
|
||||
- appcenter_analytics (0.0.1):
|
||||
- AppCenter/Analytics
|
||||
- Flutter
|
||||
- appcenter_crashes (0.0.1):
|
||||
- AppCenter/Crashes
|
||||
- Flutter
|
||||
- Flutter (1.0.0)
|
||||
|
||||
DEPENDENCIES:
|
||||
- appcenter (from `/Users/alois/flutter_plugin_appcenter/src/appcenter/ios`)
|
||||
- appcenter_analytics (from `/Users/alois/flutter_plugin_appcenter/src/appcenter_analytics/ios`)
|
||||
- appcenter_crashes (from `/Users/alois/flutter_plugin_appcenter/src/appcenter_crashes/ios`)
|
||||
- Flutter (from `/Users/alois/flutter/bin/cache/artifacts/engine/ios`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
appcenter:
|
||||
:path: /Users/alois/flutter_plugin_appcenter/src/appcenter/ios
|
||||
appcenter_analytics:
|
||||
:path: /Users/alois/flutter_plugin_appcenter/src/appcenter_analytics/ios
|
||||
appcenter_crashes:
|
||||
:path: /Users/alois/flutter_plugin_appcenter/src/appcenter_crashes/ios
|
||||
Flutter:
|
||||
:path: /Users/alois/flutter/bin/cache/artifacts/engine/ios
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
AppCenter: 1d9e08e4ffe7a8eab6e9741a12d27e44074e73a7
|
||||
appcenter: ec63d9079174977ead44a0040ff083d6dd4c94c5
|
||||
appcenter_analytics: 46cd35cb5fac57f7a4b2ae5d5040f984b4ad4b5a
|
||||
appcenter_crashes: 1b06d86617183e4778779b59f85a25c4bbc89493
|
||||
Flutter: d674e78c937094a75ac71dd77e921e840bea3dbf
|
||||
|
||||
PODFILE CHECKSUM: 351e02e34b831289961ec3558a535cbd2c4965d2
|
||||
|
||||
COCOAPODS: 1.3.1
|
||||
@@ -11,6 +11,7 @@
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
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, ); }; };
|
||||
513419C92C83CB08834F5354 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 54CE9D792210C22D5C6E8F8E /* libPods-Runner.a */; };
|
||||
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 */; };
|
||||
@@ -43,6 +44,7 @@
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
54CE9D792210C22D5C6E8F8E /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
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>"; };
|
||||
@@ -65,12 +67,28 @@
|
||||
files = (
|
||||
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
|
||||
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
|
||||
513419C92C83CB08834F5354 /* libPods-Runner.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
0AF805DA95AB24C0E846AF07 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
54CE9D792210C22D5C6E8F8E /* libPods-Runner.a */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
655B30EC1DAC555983B099AB /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -91,7 +109,8 @@
|
||||
9740EEB11CF90186004384FC /* Flutter */,
|
||||
97C146F01CF9000F007C117D /* Runner */,
|
||||
97C146EF1CF9000F007C117D /* Products */,
|
||||
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
|
||||
655B30EC1DAC555983B099AB /* Pods */,
|
||||
0AF805DA95AB24C0E846AF07 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -134,12 +153,15 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
51044FEB4B5932DC48FE2B1F /* [CP] Check Pods Manifest.lock */,
|
||||
9740EEB61CF901F6004384FC /* Run Script */,
|
||||
97C146EA1CF9000F007C117D /* Sources */,
|
||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||
97C146EC1CF9000F007C117D /* Resources */,
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
96D9A8465C60EEE798E7F303 /* [CP] Embed Pods Frameworks */,
|
||||
18512D816A7A23D58E333AC8 /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -200,6 +222,21 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
18512D816A7A23D58E333AC8 /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -214,6 +251,42 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
|
||||
};
|
||||
51044FEB4B5932DC48FE2B1F /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
96D9A8465C60EEE798E7F303 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
|
||||
"${PODS_ROOT}/../../../../flutter/bin/cache/artifacts/engine/ios/Flutter.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
||||
@@ -4,4 +4,7 @@
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
||||
+44
-14
@@ -1,6 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:appcenter/appcenter.dart';
|
||||
import 'package:appcenter_analytics/appcenter_analytics.dart';
|
||||
import 'package:appcenter_crashes/appcenter_crashes.dart';
|
||||
import 'package:flutter/foundation.dart' show defaultTargetPlatform;
|
||||
import 'package:flutter/foundation.dart' show TargetPlatform;
|
||||
|
||||
void main() => runApp(new MyApp());
|
||||
|
||||
@@ -10,7 +14,15 @@ class MyApp extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> {
|
||||
String _platformVersion = 'Unknown';
|
||||
|
||||
String _app_secret;
|
||||
String _installId = 'Unknown';
|
||||
bool _areAnalyticsEnabled = false, _areCrashesEnabled = false;
|
||||
|
||||
_MyAppState() {
|
||||
final ios = defaultTargetPlatform == TargetPlatform.iOS;
|
||||
_app_secret = ios ? "a8a33033-ef2f-4911-a664-a7d118287ce7" : "3f1f3b0e-24ff-436a-b42d-3c08b117d46a";
|
||||
}
|
||||
|
||||
@override
|
||||
initState() {
|
||||
@@ -20,22 +32,20 @@ class _MyAppState extends State<MyApp> {
|
||||
|
||||
// Platform messages are asynchronous, so we initialize in an async method.
|
||||
initPlatformState() async {
|
||||
String platformVersion;
|
||||
// Platform messages may fail, so we use a try/catch PlatformException.
|
||||
try {
|
||||
platformVersion = await Appcenter.platformVersion;
|
||||
} on PlatformException {
|
||||
platformVersion = 'Failed to get platform version.';
|
||||
}
|
||||
await AppCenter.start(_app_secret, [AppCenterAnalytics.id, AppCenterCrashes.id]);
|
||||
|
||||
// If the widget was removed from the tree while the asynchronous platform
|
||||
// message was in flight, we want to discard the reply rather than calling
|
||||
// setState to update our non-existent appearance.
|
||||
if (!mounted)
|
||||
return;
|
||||
|
||||
var installId = await AppCenter.installId;
|
||||
|
||||
var areAnalyticsEnabled = await AppCenterAnalytics.isEnabled;
|
||||
var areCrashesEnabled = await AppCenterCrashes.isEnabled;
|
||||
|
||||
setState(() {
|
||||
_platformVersion = platformVersion;
|
||||
_installId = installId;
|
||||
_areAnalyticsEnabled = areAnalyticsEnabled;
|
||||
_areCrashesEnabled = areCrashesEnabled;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -46,8 +56,28 @@ class _MyAppState extends State<MyApp> {
|
||||
appBar: new AppBar(
|
||||
title: new Text('Plugin example app'),
|
||||
),
|
||||
body: new Center(
|
||||
child: new Text('Running on: $_platformVersion\n'),
|
||||
body: new Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
new Text('Install identifier: $_installId'),
|
||||
new Text('Analytics: $_areAnalyticsEnabled'),
|
||||
new Text('Crashes: $_areCrashesEnabled'),
|
||||
new Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
new Text('Send events'),
|
||||
new IconButton(
|
||||
icon: new Icon(Icons.map),
|
||||
tooltip: 'map',
|
||||
onPressed: () { AppcenterAnalytics.trackEvent("map"); },
|
||||
),
|
||||
new IconButton(
|
||||
icon: new Icon(Icons.casino),
|
||||
tooltip: 'casino',
|
||||
onPressed: () { AppcenterAnalytics.trackEvent("casino", { "dollars" : "10" }); },
|
||||
),
|
||||
])
|
||||
]
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
+6
-42
@@ -4,9 +4,6 @@ description: Demonstrates how to use the appcenter plugin.
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^0.1.0
|
||||
|
||||
dev_dependencies:
|
||||
@@ -14,46 +11,13 @@ dev_dependencies:
|
||||
sdk: flutter
|
||||
|
||||
appcenter:
|
||||
path: ../
|
||||
path: ../src/appcenter
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://www.dartlang.org/tools/pub/pubspec
|
||||
appcenter_analytics:
|
||||
path: ../src/appcenter_analytics
|
||||
|
||||
appcenter_crashes:
|
||||
path: ../src/appcenter_crashes
|
||||
|
||||
# The following section is specific to Flutter.
|
||||
flutter:
|
||||
|
||||
# The following line ensures that the Material Icons font is
|
||||
# included with your application, so that you can use the icons in
|
||||
# the material Icons class.
|
||||
uses-material-design: true
|
||||
|
||||
# To add assets to your application, add an assets section, like this:
|
||||
# assets:
|
||||
# - images/a_dot_burr.jpeg
|
||||
# - images/a_dot_ham.jpeg
|
||||
|
||||
# An image asset can refer to one or more resolution-specific "variants", see
|
||||
# https://flutter.io/assets-and-images/#resolution-aware.
|
||||
|
||||
# For details regarding adding assets from package dependencies, see
|
||||
# https://flutter.io/assets-and-images/#from-packages
|
||||
|
||||
# To add custom fonts to your application, add a fonts section here,
|
||||
# in this "flutter" section. Each entry in this list should have a
|
||||
# "family" key with the font family name, and a "fonts" key with a
|
||||
# list giving the asset and other descriptors for the font. For
|
||||
# example:
|
||||
# fonts:
|
||||
# - family: Schyler
|
||||
# fonts:
|
||||
# - asset: fonts/Schyler-Regular.ttf
|
||||
# - asset: fonts/Schyler-Italic.ttf
|
||||
# style: italic
|
||||
# - family: Trajan Pro
|
||||
# fonts:
|
||||
# - asset: fonts/TrajanPro.ttf
|
||||
# - asset: fonts/TrajanPro_Bold.ttf
|
||||
# weight: 700
|
||||
#
|
||||
# For details regarding fonts from package dependencies,
|
||||
# see https://flutter.io/custom-fonts/#from-packages
|
||||
|
||||
Reference in New Issue
Block a user