Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
umeng_common_flutter
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
flutter-plugin
umeng_common_flutter
Commits
4cd28c4a
Commit
4cd28c4a
authored
Sep 03, 2021
by
汪林玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iOS事件
parent
b7e96935
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
86 deletions
+104
-86
example/ios/Podfile.lock
example/ios/Podfile.lock
+34
-0
example/ios/Runner.xcodeproj/project.pbxproj
example/ios/Runner.xcodeproj/project.pbxproj
+6
-6
example/lib/main.dart
example/lib/main.dart
+31
-5
example/pubspec.yaml
example/pubspec.yaml
+1
-52
example/test/widget_test.dart
example/test/widget_test.dart
+0
-1
ios/Classes/UmengCommonSdkPlugin.m
ios/Classes/UmengCommonSdkPlugin.m
+31
-21
ios/umeng_common_sdk.podspec
ios/umeng_common_sdk.podspec
+1
-1
No files found.
example/ios/Podfile.lock
0 → 100644
View file @
4cd28c4a
PODS:
- Flutter (1.0.0)
- UMCommon (7.3.5):
- UMDevice
- UMDevice (2.0.4)
- umeng_common_sdk (1.0.0):
- Flutter
- UMCommon
- UMDevice
DEPENDENCIES:
- Flutter (from `Flutter`)
- umeng_common_sdk (from `.symlinks/plugins/umeng_common_sdk/ios`)
SPEC REPOS:
trunk:
- UMCommon
- UMDevice
EXTERNAL SOURCES:
Flutter:
:path: Flutter
umeng_common_sdk:
:path: ".symlinks/plugins/umeng_common_sdk/ios"
SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
UMCommon: ab4d875ddefe1b06c60b577e4a58bc4d433ee067
UMDevice: 590115ebb238250e574988c7a3e9511f5d5cd4d3
umeng_common_sdk: 51fabf3b59f6a0f293a6fc0d35251c943d2f69ab
PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d
COCOAPODS: 1.10.1
example/ios/Runner.xcodeproj/project.pbxproj
View file @
4cd28c4a
...
...
@@ -365,7 +365,7 @@
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CURRENT_PROJECT_VERSION
=
"$(FLUTTER_BUILD_NUMBER)"
;
DEVELOPMENT_TEAM
=
4
86K7NX823
;
DEVELOPMENT_TEAM
=
4
R6KK56452
;
ENABLE_BITCODE
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
@@ -380,7 +380,7 @@
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter"
,
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.umeng.umengComm
onSdkExample
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.umeng.umengComm
12
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
VERSIONING_SYSTEM
=
"apple-generic"
;
};
...
...
@@ -497,7 +497,7 @@
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CURRENT_PROJECT_VERSION
=
"$(FLUTTER_BUILD_NUMBER)"
;
DEVELOPMENT_TEAM
=
4
86K7NX823
;
DEVELOPMENT_TEAM
=
4
R6KK56452
;
ENABLE_BITCODE
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
@@ -512,7 +512,7 @@
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter"
,
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.umeng.umengComm
onSdkExample
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.umeng.umengComm
12
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
VERSIONING_SYSTEM
=
"apple-generic"
;
};
...
...
@@ -524,7 +524,7 @@
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CURRENT_PROJECT_VERSION
=
"$(FLUTTER_BUILD_NUMBER)"
;
DEVELOPMENT_TEAM
=
4
86K7NX823
;
DEVELOPMENT_TEAM
=
4
R6KK56452
;
ENABLE_BITCODE
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
@@ -539,7 +539,7 @@
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter"
,
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.umeng.umengComm
onSdkExample
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.umeng.umengComm
12
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
VERSIONING_SYSTEM
=
"apple-generic"
;
};
...
...
example/lib/main.dart
View file @
4cd28c4a
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:umeng_common_sdk/umeng_common_sdk.dart'
;
...
...
@@ -14,16 +16,22 @@ class _MyAppState extends State<MyApp> {
@override
void
initState
()
{
UmengCommonSdk
.
preInit
(
appKey:
'6130b199695f794bbd9cb984'
,
appKey:
Platform
.
isIOS
?
'6131e783695f794bbd9ed608'
:
'6130b199695f794bbd9cb984'
,
channel:
'qiaomeng'
,
enableLog:
true
,
).
then
((
value
)
{}).
whenComplete
(()
{
Future
.
delayed
(
Duration
(
seconds:
15
),
()
{
UmengCommonSdk
.
init
(
appKey:
'6130b199695f794bbd9cb984'
,
appKey:
Platform
.
isIOS
?
'6131e783695f794bbd9ed608'
:
'6130b199695f794bbd9cb984'
,
channel:
'qiaomeng'
,
deviceType:
1
,
pushSecret:
'6130b199695f794bbd9cb984'
,
pushSecret:
Platform
.
isIOS
?
'6131e783695f794bbd9ed608'
:
'6130b199695f794bbd9cb984'
,
);
});
});
...
...
@@ -42,13 +50,31 @@ class _MyAppState extends State<MyApp> {
await
UmengCommonSdk
.
onEvent
(
event:
'event_test'
,
properties:
{
'key'
:
'
测试上传
数据'
,
'key1'
:
'
测试上传
数据'
,
'key'
:
'
Key
数据'
,
'key1'
:
'
Key1
数据'
,
},
);
},
child:
Text
(
'上报事件'
),
),
TextButton
(
onPressed:
()
async
{
await
UmengCommonSdk
.
onPageStart
(
pageName:
"/PAGE/HOST/A"
);
},
child:
Text
(
'页面打开'
),
),
TextButton
(
onPressed:
()
async
{
await
UmengCommonSdk
.
onPageStart
(
pageName:
"/PAGE/HOST/B"
);
},
child:
Text
(
'关闭'
),
),
TextButton
(
onPressed:
()
async
{
await
UmengCommonSdk
.
onSignIn
(
userId:
"user_id"
);
},
child:
Text
(
'用户登陆'
),
),
],
),
),
...
...
example/pubspec.yaml
View file @
4cd28c4a
name
:
umeng_common_sdk_example
description
:
Demonstrates how to use the umeng_common_sdk plugin.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to
:
'
none'
# Remove this line if you wish to publish to pub.dev
environment
:
...
...
@@ -13,59 +11,10 @@ dependencies:
sdk
:
flutter
umeng_common_sdk
:
# When depending on this package from a real application you should use:
# umeng_common_sdk: ^x.y.z
# See https://dart.dev/tools/pub/dependencies#version-constraints
# The example app is bundled with the plugin so we use a path dependency on
# the parent directory to use the current plugin's version.
path
:
../
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons
:
^1.0.3
dev_dependencies
:
flutter_test
:
sdk
:
flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# 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.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/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.dev/custom-fonts/#from-packages
uses-material-design
:
true
\ No newline at end of file
example/test/widget_test.dart
View file @
4cd28c4a
...
...
@@ -5,7 +5,6 @@
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
...
...
ios/Classes/UmengCommonSdkPlugin.m
View file @
4cd28c4a
...
...
@@ -8,12 +8,18 @@
+
(
BOOL
)
handleMethodCall
:(
FlutterMethodCall
*
)
call
result
:(
FlutterResult
)
result
{
BOOL
resultCode
=
YES
;
if
([
@"initCommon"
isEqualToString
:
call
.
method
]){
NSArray
*
arguments
=
(
NSArray
*
)
call
.
arguments
;
NSString
*
appkey
=
arguments
[
1
];
NSString
*
channel
=
arguments
[
2
];
[
UMConfigure
initWithAppkey
:
appkey
channel
:
channel
];
//result(@"success");
if
([
@"preInit"
isEqualToString
:
call
.
method
]){
NSString
*
appKey
=
call
.
arguments
[
@"appKey"
];
NSString
*
channel
=
call
.
arguments
[
@"channel"
];
NSNumber
*
enableLog
=
call
.
arguments
[
@"enableLog"
];
[
UMConfigure
setLogEnabled
:
enableLog
.
intValue
==
1
];
result
(
@YES
);
NSLog
(
@"========> appKey:%@ channel:%@ enableLog:%@"
,
appKey
,
channel
,
enableLog
);
}
else
if
([
@"init"
isEqualToString
:
call
.
method
]){
NSString
*
appKey
=
call
.
arguments
[
@"appKey"
];
NSString
*
channel
=
call
.
arguments
[
@"channel"
];
[
UMConfigure
initWithAppkey
:
appKey
channel
:
channel
];
result
(
@YES
);
}
else
{
resultCode
=
NO
;
...
...
@@ -28,21 +34,25 @@
+
(
BOOL
)
handleMethodCall
:(
FlutterMethodCall
*
)
call
result
:(
FlutterResult
)
result
{
BOOL
resultCode
=
YES
;
NSArray
*
arguments
=
(
NSArray
*
)
call
.
arguments
;
if
([
@"onEvent"
isEqualToString
:
call
.
method
]){
NSString
*
eventName
=
arguments
[
0
];
NSDictionary
*
properties
=
arguments
[
1
];
[
MobClick
event
:
event
Name
attributes
:
properties
];
//result(@"success"
);
NSString
*
eventId
=
call
.
arguments
[
@"eventId"
];
NSDictionary
*
properties
=
call
.
arguments
[
@"properties"
];
[
MobClick
event
:
event
Id
attributes
:
properties
];
result
(
@YES
);
}
else
if
([
@"onProfileSignIn"
isEqualToString
:
call
.
method
]){
NSString
*
userID
=
arguments
[
0
];
[
MobClick
profileSignInWithPUID
:
userID
];
//result(@"success");
else
if
([
@"onSignIn"
isEqualToString
:
call
.
method
]){
NSString
*
userId
=
call
.
arguments
[
@"userId"
];
NSString
*
provider
=
call
.
arguments
[
@"provider"
];
if
(
provider
){
[
MobClick
profileSignInWithPUID
:
userId
provider
:
provider
];
}
else
{
[
MobClick
profileSignInWithPUID
:
userId
];
}
result
(
@YES
);
}
else
if
([
@"on
Profile
SignOff"
isEqualToString
:
call
.
method
]){
else
if
([
@"onSignOff"
isEqualToString
:
call
.
method
]){
[
MobClick
profileSignOff
];
//result(@"success"
);
result
(
@YES
);
}
else
if
([
@"setPageCollectionModeAuto"
isEqualToString
:
call
.
method
]){
[
MobClick
setAutoPageEnabled
:
YES
];
...
...
@@ -53,14 +63,14 @@
//result(@"success");
}
else
if
([
@"onPageStart"
isEqualToString
:
call
.
method
]){
NSString
*
pageName
=
arguments
[
0
];
NSString
*
pageName
=
call
.
arguments
[
@"pageName"
];
[
MobClick
beginLogPageView
:
pageName
];
//result(@"success"
);
result
(
@YES
);
}
else
if
([
@"onPageEnd"
isEqualToString
:
call
.
method
]){
NSString
*
pageName
=
arguments
[
0
];
NSString
*
pageName
=
call
.
arguments
[
@"pageName"
];
[
MobClick
endLogPageView
:
pageName
];
//result(@"success"
);
result
(
@YES
);
}
else
if
([
@"reportError"
isEqualToString
:
call
.
method
]){
NSLog
(
@"reportError API not existed "
);
...
...
ios/umeng_common_sdk.podspec
View file @
4cd28c4a
...
...
@@ -4,7 +4,7 @@
#
Pod
::
Spec
.
new
do
|
s
|
s
.
name
=
'umeng_common_sdk'
s
.
version
=
'
0.0.1
'
s
.
version
=
'
1.0.0
'
s
.
summary
=
'A new Flutter plugin.'
s
.
description
=
<<-
DESC
A new Flutter plugin.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment