├── .dart_tool └── package_config.json ├── .github └── workflows │ └── publish.yml ├── .gitignore ├── .idea ├── codeStyles │ └── Project.xml ├── jshare-flutter-plugin.iml ├── libraries │ ├── Dart_SDK.xml │ └── Flutter_Plugins.xml ├── modules.xml ├── vcs.xml └── workspace.xml ├── .packages ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── cn │ └── jiguang │ └── jshare_flutter_plugin │ ├── JShareMessage.java │ └── JshareFlutterPlugin.java ├── documents └── APIs.md ├── example ├── .flutter-plugins-dependencies ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── app │ │ ├── build.gradle │ │ ├── jshare.jks │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── cn │ │ │ │ │ └── jiguang │ │ │ │ │ ├── jshare_flutter_plugin_example │ │ │ │ │ └── MainActivity.java │ │ │ │ │ └── share │ │ │ │ │ └── demo │ │ │ │ │ └── wxapi │ │ │ │ │ └── WXEntryActivity.java │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ ├── values │ │ │ │ └── styles.xml │ │ │ │ └── xml │ │ │ │ ├── jshare_file_provider_paths.xml │ │ │ │ └── network_security_config.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── assets │ └── images │ │ ├── icon_jiguang.png │ │ ├── jiguang_socialize_cp_link.png │ │ ├── jiguang_socialize_facebook.png │ │ ├── jiguang_socialize_menu_default.png │ │ ├── jiguang_socialize_messenger.png │ │ ├── jiguang_socialize_qq.png │ │ ├── jiguang_socialize_qzone.png │ │ ├── jiguang_socialize_sina.png │ │ ├── jiguang_socialize_twitter.png │ │ ├── jiguang_socialize_wechat.png │ │ ├── jiguang_socialize_wxfavorite.png │ │ └── jiguang_socialize_wxtimeLine.png ├── ios │ ├── Flutter │ │ ├── .last_build_id │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ ├── Flutter.podspec │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart ├── pubspec.lock ├── pubspec.yaml └── test │ └── widget_test.dart ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── JshareFlutterPlugin.h │ └── JshareFlutterPlugin.m └── jshare_flutter_plugin.podspec ├── jshare_flutter_plugin.iml ├── lib └── jshare_flutter_plugin.dart ├── pubspec.lock ├── pubspec.yaml ├── res ├── set_ios_scheme.jpg ├── set_ios_scheme2.png └── set_wxapi.png └── test └── jshare_flutter_plugin_test.dart /.dart_tool/package_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "configVersion": 2, 3 | "packages": [ 4 | { 5 | "name": "async", 6 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/async-2.6.1", 7 | "packageUri": "lib/", 8 | "languageVersion": "2.12" 9 | }, 10 | { 11 | "name": "boolean_selector", 12 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0", 13 | "packageUri": "lib/", 14 | "languageVersion": "2.12" 15 | }, 16 | { 17 | "name": "characters", 18 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/characters-1.1.0", 19 | "packageUri": "lib/", 20 | "languageVersion": "2.12" 21 | }, 22 | { 23 | "name": "charcode", 24 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.2.0", 25 | "packageUri": "lib/", 26 | "languageVersion": "2.12" 27 | }, 28 | { 29 | "name": "clock", 30 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0", 31 | "packageUri": "lib/", 32 | "languageVersion": "2.12" 33 | }, 34 | { 35 | "name": "collection", 36 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0", 37 | "packageUri": "lib/", 38 | "languageVersion": "2.12" 39 | }, 40 | { 41 | "name": "fake_async", 42 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.2.0", 43 | "packageUri": "lib/", 44 | "languageVersion": "2.12" 45 | }, 46 | { 47 | "name": "flutter", 48 | "rootUri": "file:///D:/Workspace/android/flutter/packages/flutter", 49 | "packageUri": "lib/", 50 | "languageVersion": "2.12" 51 | }, 52 | { 53 | "name": "flutter_test", 54 | "rootUri": "file:///D:/Workspace/android/flutter/packages/flutter_test", 55 | "packageUri": "lib/", 56 | "languageVersion": "2.12" 57 | }, 58 | { 59 | "name": "matcher", 60 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.10", 61 | "packageUri": "lib/", 62 | "languageVersion": "2.12" 63 | }, 64 | { 65 | "name": "meta", 66 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.3.0", 67 | "packageUri": "lib/", 68 | "languageVersion": "2.12" 69 | }, 70 | { 71 | "name": "path", 72 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/path-1.8.0", 73 | "packageUri": "lib/", 74 | "languageVersion": "2.12" 75 | }, 76 | { 77 | "name": "sky_engine", 78 | "rootUri": "file:///D:/Workspace/android/flutter/bin/cache/pkg/sky_engine", 79 | "packageUri": "lib/", 80 | "languageVersion": "2.12" 81 | }, 82 | { 83 | "name": "source_span", 84 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.1", 85 | "packageUri": "lib/", 86 | "languageVersion": "2.12" 87 | }, 88 | { 89 | "name": "stack_trace", 90 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.0", 91 | "packageUri": "lib/", 92 | "languageVersion": "2.12" 93 | }, 94 | { 95 | "name": "stream_channel", 96 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0", 97 | "packageUri": "lib/", 98 | "languageVersion": "2.12" 99 | }, 100 | { 101 | "name": "string_scanner", 102 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.0", 103 | "packageUri": "lib/", 104 | "languageVersion": "2.12" 105 | }, 106 | { 107 | "name": "term_glyph", 108 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0", 109 | "packageUri": "lib/", 110 | "languageVersion": "2.12" 111 | }, 112 | { 113 | "name": "test_api", 114 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.3.0", 115 | "packageUri": "lib/", 116 | "languageVersion": "2.12" 117 | }, 118 | { 119 | "name": "typed_data", 120 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0", 121 | "packageUri": "lib/", 122 | "languageVersion": "2.12" 123 | }, 124 | { 125 | "name": "vector_math", 126 | "rootUri": "file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.0", 127 | "packageUri": "lib/", 128 | "languageVersion": "2.12" 129 | }, 130 | { 131 | "name": "jshare_flutter_plugin", 132 | "rootUri": "../", 133 | "packageUri": "lib/", 134 | "languageVersion": "2.12" 135 | } 136 | ], 137 | "generated": "2021-05-21T06:55:39.614488Z", 138 | "generator": "pub", 139 | "generatorVersion": "2.13.0" 140 | } 141 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: publish 2 | 3 | on: 4 | push: 5 | tags: 6 | - v* 7 | 8 | jobs: 9 | build: 10 | 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Publish Dart/Flutter package 17 | uses: sakebook/actions-flutter-pub-publisher@v1.3.1 18 | with: 19 | credential: ${{ secrets.JSHARE_CREDENTIAL_JSON }} 20 | flutter_package: false 21 | skip_test: true 22 | dry_run: false 23 | 24 | 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | .idea/ 9 | .metadata 10 | 11 | pubspec.lock 12 | example/pubspec.lock 13 | example/.flutter-plugins-dependencies 14 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | xmlns:android 11 | 12 | ^$ 13 | 14 | 15 | 16 |
17 |
18 | 19 | 20 | 21 | xmlns:.* 22 | 23 | ^$ 24 | 25 | 26 | BY_NAME 27 | 28 |
29 |
30 | 31 | 32 | 33 | .*:id 34 | 35 | http://schemas.android.com/apk/res/android 36 | 37 | 38 | 39 |
40 |
41 | 42 | 43 | 44 | .*:name 45 | 46 | http://schemas.android.com/apk/res/android 47 | 48 | 49 | 50 |
51 |
52 | 53 | 54 | 55 | name 56 | 57 | ^$ 58 | 59 | 60 | 61 |
62 |
63 | 64 | 65 | 66 | style 67 | 68 | ^$ 69 | 70 | 71 | 72 |
73 |
74 | 75 | 76 | 77 | .* 78 | 79 | ^$ 80 | 81 | 82 | BY_NAME 83 | 84 |
85 |
86 | 87 | 88 | 89 | .* 90 | 91 | http://schemas.android.com/apk/res/android 92 | 93 | 94 | ANDROID_ATTRIBUTE_ORDER 95 | 96 |
97 |
98 | 99 | 100 | 101 | .* 102 | 103 | .* 104 | 105 | 106 | BY_NAME 107 | 108 |
109 |
110 |
111 |
112 |
113 |
-------------------------------------------------------------------------------- /.idea/jshare-flutter-plugin.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 1577243239180 68 | 72 | 73 | 1616750257398 74 | 79 | 80 | 1617071123613 81 | 86 | 87 | 1619158375341 88 | 93 | 94 | 1619336011513 95 | 100 | 101 | 1621408064185 102 | 107 | 108 | 1621581632057 109 | 114 | 115 | 1621582968465 116 | 121 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 1.8 194 | 195 | 200 | 201 | 202 | 203 | 204 | 205 | -------------------------------------------------------------------------------- /.packages: -------------------------------------------------------------------------------- 1 | # This file is deprecated. Tools should instead consume 2 | # `.dart_tools/package_config.json`. 3 | # 4 | # For more info see: https://dart.dev/go/dot-packages-deprecation 5 | # 6 | # Generated by pub on 2021-05-21 14:55:39.599528. 7 | async:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/async-2.6.1/lib/ 8 | boolean_selector:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0/lib/ 9 | characters:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/characters-1.1.0/lib/ 10 | charcode:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.2.0/lib/ 11 | clock:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0/lib/ 12 | collection:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0/lib/ 13 | fake_async:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.2.0/lib/ 14 | flutter:file:///D:/Workspace/android/flutter/packages/flutter/lib/ 15 | flutter_test:file:///D:/Workspace/android/flutter/packages/flutter_test/lib/ 16 | matcher:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.10/lib/ 17 | meta:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.3.0/lib/ 18 | path:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/path-1.8.0/lib/ 19 | sky_engine:file:///D:/Workspace/android/flutter/bin/cache/pkg/sky_engine/lib/ 20 | source_span:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.1/lib/ 21 | stack_trace:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.0/lib/ 22 | stream_channel:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0/lib/ 23 | string_scanner:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.0/lib/ 24 | term_glyph:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0/lib/ 25 | test_api:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.3.0/lib/ 26 | typed_data:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0/lib/ 27 | vector_math:file:///D:/Workspace/android/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.0/lib/ 28 | jshare_flutter_plugin:lib/ 29 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 2.1.2 2 | + 升级: 升级 android jcore 2.8.2 3 | ## 2.1.0 4 | + 适配: 适配 null safety 5 | ## 2.0.5 6 | + 新增:升级 android jcore 2.7.8 7 | ## 2.0.3 8 | + 新增:升级 android 分享 2.0.0 9 | ## 2.0.1 10 | + 适配Flutter 2.0 11 | ## 1.0.5 12 | + bug fix 13 | ## 1.0.3 14 | + ios 新增universal link 15 | ## 1.0.2 16 | + 内部安全策略优化 17 | ## 1.0.1 18 | + 修改文档 19 | # 1.0.0 20 | + jshare-flutter-plugin 第一版本 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 极光开发者 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jshare-flutter-plugin 2 | JIGUANG officially supported JShare SDK Flutter plugin (Android & iOS). 极光分享官方支持的 Flutter 插件(Android & iOS)。 3 | 4 | 5 | ### 一、安装 6 | 7 | 在工程 pubspec.yaml 中加入 dependencies 8 | 9 | + github 集成 10 | 11 | ``` 12 | dependencies: 13 | jshare_flutter_plugin: 14 | git: 15 | url: git://github.com/jpush/jshare-flutter-plugin.git 16 | ref: master 17 | ``` 18 | 19 | + pub 集成 20 | 21 | ``` 22 | dependencies: 23 | jshare_flutter_plugin: 2.1.2 24 | ``` 25 | 26 | ### 二、配置 27 | 28 | #### 2.1 Android: 29 | 30 | ##### 2.1.1 gradle 配置 31 | 32 | 在 `example/android/app/build.gradle` 中添加下列代码: 33 | 34 | ```groovy 35 | android: { 36 | .... 37 | defaultConfig { 38 | applicationId "替换成自己应用 ID" 39 | ... 40 | ndk { 41 | //选择要添加的对应 cpu 类型的 .so 库。 42 | abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a', 43 | } 44 | 45 | manifestPlaceholders = [ 46 | JPUSH_PKGNAME : applicationId, 47 | JPUSH_APPKEY : "appkey", // NOTE: JPush 上注册的包名对应的 Appkey. 48 | JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可. 49 | ] 50 | } 51 | } 52 | ``` 53 | 54 | ##### 2.1.2 配置微信平台回调 55 | 56 | 在你的包名相应目录下新建一个wxapi目录,并在该wxapi目录下新增一个WXEntryActivity类,该类继承自WeChatHandleActivity(例如应用程序的包名为cn.jiguang.share.demo,则新添加的类如下图所示) 57 | ![](./res/set_wxapi.png) 58 | 59 | 注意: 如果复写了onCreate方法、onNewIntent方法,那么必须调用父类方法,否者无法获取分享结果,例如: 60 | 61 | ``` 62 | @Override 63 | protected void onCreate(Bundle savedInstanceState) { 64 | super.onCreate(savedInstanceState); 65 | } 66 | 67 | @Override 68 | protected void onNewIntent(Intent intent) { 69 | super.onNewIntent(intent); 70 | } 71 | ``` 72 | + 并在 manifest 文件里面加上exported属性,设置为true,例如: 73 | 74 | ``` 75 | 79 | ``` 80 | 81 | ##### 2.1.3 配置Facebook平台 82 | + 在`example/android/app/src/main/` 目录下的 `manifest` 文件里面添加 `Facebook`的`ContentProvider`配置: 83 | 84 | ``` 85 | 90 | ``` 91 | ***注意:*** `provider`的`authorities`必须为`"com.facebook.app.FacebookContentProvider"+"AppId"`。 92 | + 如果需要获取`facebook`上传图片、视频结果可自定义`BroadCastReceiver`,继承`FacebookBroadcastReceiver`,复写`onSuccessfulAppCall、onFailedAppCall`方法: 93 | 94 | ``` 95 | 96 | 97 | 98 | 99 | 100 | ``` 101 | ***注意***: `receiver`的`action`必须为`"com.facebook.platform.AppCallResultBroadcast"`。 102 | 103 | #### 2.2 iOS 104 | iOS 的功能目录为`example/ios/` 105 | ##### 2.2.1 配置 ApplicationQueriesSchemes 106 | 107 | 在 `iOS9/10` 下就需要增加一个应用可跳转的白名单,即 `LSApplicationQueriesSchemes`,否则将在 `SDK` 判断是否跳转时用到的`canOpenURL` 时返回 NO,进而只进行 `webview` 分享/分享失败。 108 | 109 | 在`example/ios/Runner/`目录中的`info.plist` 中加入应用白名单: 110 | 111 | + 右键 `info.plist` 112 | + 选择 source code 113 | + 添加如下内容: 114 | 115 | ``` 116 | LSApplicationQueriesSchemes 117 | 118 | 119 | wechat 120 | weixin 121 | 122 | 123 | sinaweibohd 124 | sinaweibo 125 | sinaweibosso 126 | weibosdk 127 | weibosdk2.5 128 | 129 | 130 | mqqapi 131 | mqq 132 | mqqOpensdkSSoLogin 133 | mqqconnect 134 | mqqopensdkdataline 135 | mqqopensdkgrouptribeshare 136 | mqqopensdkfriend 137 | mqqopensdkapi 138 | mqqopensdkapiV2 139 | mqqopensdkapiV3 140 | mqqopensdkapiV4 141 | mqzoneopensdk 142 | wtloginmqq 143 | wtloginmqq2 144 | mqqwpa 145 | mqzone 146 | mqzonev2 147 | mqzoneshare 148 | wtloginqzone 149 | mqzonewx 150 | mqzoneopensdkapiV2 151 | mqzoneopensdkapi19 152 | mqzoneopensdkapi 153 | mqqbrowser 154 | mttbrowser 155 | 156 | 157 | fbapi 158 | fb-messenger-api 159 | fbauth2 160 | fbshareextension 161 | 162 | 163 | twitter 164 | twitterauth 165 | 166 | 167 | JChatPro 168 | 169 | ``` 170 | 171 | ##### 2.2.2 添加 URL Types 172 | 173 | + 各个平台的 URL Schemes 格式说明: 174 | ![](./res/set_ios_scheme.jpg) 175 | 176 | + URL Types 设置 177 | 178 | Xcode 打开工程 `example/ios/Runner.xcworkspace`目录中的 [TARGETS] -> [Info] 中设置: 179 | ![](./res/set_ios_scheme2.png) 180 | 181 | ##### 2.3 iOS/Android 详细集成配置文档 182 | + [iOS 集成配置](https://docs.jiguang.cn/jshare/client/iOS/ios_sdk/) 183 | + [Android 集成配置](https://docs.jiguang.cn/jshare/client/Android/android_sdk/) 184 | 185 | ### 三、使用 186 | 187 | ```dart 188 | import 'package:jshare_flutter_plugin/jshare_flutter_plugin.dart'; 189 | ``` 190 | 191 | ### APIs 192 | 193 | **注意** : 需要先调用 JShare.setup 来初始化插件,才能保证其他功能正常工作。 194 | 195 | [参考](./documents/APIs.md) 196 | 197 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'cn.jiguang.jshare_flutter_plugin' 2 | version '1.0' 3 | 4 | buildscript { 5 | repositories { 6 | mavenCentral() 7 | google() 8 | jcenter() 9 | } 10 | 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:3.2.1' 13 | } 14 | } 15 | 16 | rootProject.allprojects { 17 | repositories { 18 | mavenCentral() 19 | google() 20 | jcenter() 21 | } 22 | } 23 | 24 | apply plugin: 'com.android.library' 25 | 26 | android { 27 | compileSdkVersion 28 28 | 29 | defaultConfig { 30 | minSdkVersion 16 31 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 32 | } 33 | lintOptions { 34 | disable 'InvalidPackage' 35 | } 36 | } 37 | 38 | dependencies { 39 | implementation 'cn.jiguang.sdk:jshare:2.0.0' // 此处以JShare 1.6.0 版本为例,具体版本请参考压缩包libs的jar包版本。 40 | implementation 'cn.jiguang.sdk:jshare-qqmodel:2.0.0' // 此处以jshare-qqmodel 1.6.0 版本为例,具体版本请参考压缩包libs的jar包版本。 41 | api 'cn.jiguang.sdk:jshare-wechatmodel:2.0.0' // 此处以jshare-wechatmodel 1.6.0 版本为例,具体版本请参考压缩包libs的jar包版本。 42 | implementation 'cn.jiguang.sdk:jshare-sinamodel:2.0.0' // 此处以jshare-sinamodel 1.6.0 版本为例,具体版本请参考压缩包libs的jar包版本。 43 | implementation 'cn.jiguang.sdk:jshare-facebookmodel:2.0.0' // 此处以jshare-facebookmodel 1.6.0 版本为例,具体版本请参考压缩包libs的jar包版本。 44 | implementation 'cn.jiguang.sdk:jshare-twittermodel:2.0.0' // 此处以jshare-twittermodel 1.6.0 版本为例,具体版本请参考压缩包libs的jar包版本。 45 | implementation 'cn.jiguang.sdk:jcore:2.8.2' // 此处以JCore 1.2.3版本为例,具体版本请参考压缩包libs的jar包版本。 46 | 47 | } -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | 3 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'jshare_flutter_plugin' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/java/cn/jiguang/jshare_flutter_plugin/JShareMessage.java: -------------------------------------------------------------------------------- 1 | package cn.jiguang.jshare_flutter_plugin; 2 | 3 | import java.util.Map; 4 | 5 | import cn.jiguang.share.android.api.Platform; 6 | import cn.jiguang.share.facebook.Facebook; 7 | import cn.jiguang.share.facebook.messenger.FbMessenger; 8 | import cn.jiguang.share.qqmodel.QQ; 9 | import cn.jiguang.share.qqmodel.QZone; 10 | import cn.jiguang.share.twitter.Twitter; 11 | import cn.jiguang.share.wechat.Wechat; 12 | import cn.jiguang.share.wechat.WechatFavorite; 13 | import cn.jiguang.share.wechat.WechatMoments; 14 | import cn.jiguang.share.weibo.SinaWeibo; 15 | import cn.jiguang.share.weibo.SinaWeiboMessage; 16 | 17 | /** 18 | * Create by wangqingqing 19 | * On 2021/3/26 16:07 20 | * Copyright(c) 2020 极光 21 | * Description 22 | */ 23 | public class JShareMessage { 24 | String title ; 25 | String text; 26 | String url ; 27 | String videoPath ; 28 | String imagePath ; 29 | //String imageUrl; 30 | String musicDataUrl; 31 | String extInfo ; 32 | String fileDataPath; 33 | String fileExt ; 34 | String emoticonDataPath ; 35 | String sinaObjectID ; 36 | String miniProgramUserName ; 37 | String miniProgramPath ; 38 | int miniProgramType ; 39 | Boolean miniProgramWithShareTicket; 40 | 41 | String platform; 42 | int shareType; 43 | 44 | public JShareMessage(Map argument){ 45 | title = (String)argument.get("title"); 46 | text = (String)argument.get("text"); 47 | url = (String)argument.get("url"); 48 | videoPath = (String)argument.get("videoPath"); 49 | imagePath = (String) argument.get("imagePath"); 50 | //imageUrl = (String)argument.get("imageUrl"); 51 | 52 | musicDataUrl = (String)argument.get("musicDataUrl"); 53 | extInfo = (String)argument.get("extInfo"); 54 | fileDataPath = (String)argument.get("fileDataPath"); 55 | fileExt = (String)argument.get("fileExt"); 56 | emoticonDataPath = (String)argument.get("emoticonDataPath"); 57 | sinaObjectID = (String)argument.get("sinaObjectID"); 58 | miniProgramUserName = (String)argument.get("miniProgramUserName"); 59 | miniProgramPath = (String)argument.get("miniProgramPath"); 60 | miniProgramType = (int)argument.get("miniProgramType"); 61 | miniProgramWithShareTicket = (Boolean) argument.get("miniProgramWithShareTicket"); 62 | 63 | String platformName = (String)argument.get("platform"); 64 | platform = JShareMessage.getPlatform(platformName); 65 | 66 | String mediaType = (String)argument.get("mediaType"); 67 | shareType = JShareMessage.getShareType(mediaType); 68 | } 69 | 70 | 71 | 72 | public static String getPlatform(String platformName) { 73 | String platform = null; 74 | switch (platformName){ 75 | case "wechatSession": platform = Wechat.Name; break; 76 | case "wechatTimeLine": platform = WechatMoments.Name; break; 77 | case "wechatFavourite": platform = WechatFavorite.Name; break; 78 | case "qq": platform = QQ.Name; break; 79 | case "qZone": platform = QZone.Name; break; 80 | case "sinaWeibo": platform = SinaWeibo.Name; break; 81 | case "sinaWeiboContact": platform = SinaWeiboMessage.Name; break; 82 | case "facebook": platform = Facebook.Name; break; 83 | case "facebookMessenger": platform = FbMessenger.Name; break; 84 | case "twitter": platform = Twitter.Name; break; 85 | default: 86 | platform = null; 87 | break; 88 | } 89 | return platform; 90 | } 91 | 92 | public static int getShareType(String mediaType){ 93 | int shareType = Platform.SHARE_TEXT; 94 | switch (mediaType){ 95 | case "text": 96 | shareType = Platform.SHARE_TEXT; 97 | break; 98 | case "image": 99 | shareType = Platform.SHARE_IMAGE; 100 | break; 101 | case "link": 102 | shareType = Platform.SHARE_WEBPAGE; 103 | break; 104 | case "audio": 105 | shareType = Platform.SHARE_MUSIC; 106 | break; 107 | case "video": 108 | shareType = Platform.SHARE_VIDEO; 109 | break; 110 | case "app": 111 | shareType = Platform.SHARE_APPS; 112 | break; 113 | case "file": 114 | shareType = Platform.SHARE_FILE; 115 | break; 116 | case "emoticon": 117 | shareType = Platform.SHARE_EMOJI; 118 | break; 119 | case "miniProgram": 120 | shareType = Platform.SHARE_MINI_PROGRAM; 121 | break; 122 | default: 123 | break; 124 | } 125 | return shareType; 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /android/src/main/java/cn/jiguang/jshare_flutter_plugin/JshareFlutterPlugin.java: -------------------------------------------------------------------------------- 1 | package cn.jiguang.jshare_flutter_plugin; 2 | 3 | import android.content.Context; 4 | import android.graphics.Bitmap; 5 | import android.graphics.BitmapFactory; 6 | import android.os.Handler; 7 | import android.os.Looper; 8 | 9 | import java.io.IOException; 10 | import java.io.InputStream; 11 | import java.net.HttpURLConnection; 12 | import java.net.MalformedURLException; 13 | import java.net.URL; 14 | import java.util.HashMap; 15 | import java.util.Map; 16 | 17 | import cn.jiguang.share.android.api.AuthListener; 18 | import cn.jiguang.share.android.api.JShareInterface; 19 | import cn.jiguang.share.android.api.PlatActionListener; 20 | import cn.jiguang.share.android.api.Platform; 21 | import cn.jiguang.share.android.api.PlatformConfig; 22 | import cn.jiguang.share.android.api.ShareParams; 23 | import cn.jiguang.share.android.model.AccessTokenInfo; 24 | import cn.jiguang.share.android.model.BaseResponseInfo; 25 | import cn.jiguang.share.android.model.UserInfo; 26 | import cn.jiguang.share.wechat.Wechat; 27 | import io.flutter.Log; 28 | import io.flutter.embedding.engine.plugins.FlutterPlugin; 29 | import io.flutter.plugin.common.MethodCall; 30 | import io.flutter.plugin.common.MethodChannel; 31 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler; 32 | import io.flutter.plugin.common.MethodChannel.Result; 33 | 34 | /** 35 | * Create by wangqingqing 36 | * On 2021/3/26 15:23 37 | * Copyright(c) 2020 极光 38 | * Description 39 | */ 40 | public class JshareFlutterPlugin implements FlutterPlugin, MethodCallHandler { 41 | 42 | // 定义日志 TAG 43 | private static final String TAG = "| JSHARE | Android | - "; 44 | private static String j_code_key = "code"; 45 | /// 回调的提示信息,统一返回 flutter 为 message 46 | private static String j_msg_key = "message"; 47 | // 成功 48 | private static String j_success_code = "success"; 49 | // 取消 50 | private static String j_cancel_code = "cancel"; 51 | private static String j_fail_code = "fail"; 52 | 53 | private Context context; 54 | private MethodChannel channel; 55 | 56 | 57 | @Override 58 | public void onAttachedToEngine(FlutterPluginBinding flutterPluginBinding) { 59 | channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "jshare_flutter_plugin"); 60 | channel.setMethodCallHandler(this); 61 | context = flutterPluginBinding.getApplicationContext(); 62 | } 63 | 64 | 65 | @Override 66 | public void onDetachedFromEngine(FlutterPluginBinding binding) { 67 | channel.setMethodCallHandler(null); 68 | } 69 | 70 | @Override 71 | public void onMethodCall(final MethodCall call, final Result result) { 72 | Log.d(TAG, "onMethodCall:" + call.method); 73 | 74 | if (call.method.equals("setup")) { 75 | setup(call, result); 76 | } else if (call.method.equals("shareMessage")) { 77 | shareMessage(call, result); 78 | } else if (call.method.equals("authorize")) { 79 | authorize(call, result); 80 | } else if (call.method.equals("isClientValid")) { 81 | isClientValid(call, result); 82 | } else if (call.method.equals("isPlatformAuth")) { 83 | isPlatformAuth(call, result); 84 | } else if (call.method.equals("cancelPlatformAuth")) { 85 | cancelPlatformAuth(call, result); 86 | } else if (call.method.equals("getUserInfo")) { 87 | getUserInfo(call, result); 88 | } else if (call.method.equals("getPlatformVersion")) { 89 | result.success("Android " + android.os.Build.VERSION.RELEASE); 90 | } else { 91 | result.notImplemented(); 92 | } 93 | } 94 | 95 | 96 | private void setup(MethodCall call, Result result) { 97 | 98 | Boolean isDebug = call.argument("isDebug"); 99 | String appKey = call.argument("appKey"); 100 | String weChatAppId = call.argument("weChatAppId"); 101 | String weChatAppSecret = call.argument("weChatAppSecret"); 102 | String qqAppId = call.argument("qqAppId"); 103 | String qqAppKey = call.argument("qqAppKey"); 104 | String sinaWeiboAppKey = call.argument("sinaWeiboAppKey"); 105 | String sinaWeiboAppSecret = call.argument("sinaWeiboAppSecret"); 106 | String sinaRedirectUri = call.argument("sinaRedirectUri"); 107 | String facebookAppID = call.argument("facebookAppID"); 108 | String facebookDisplayName = call.argument("facebookDisplayName"); 109 | String twitterConsumerKey = call.argument("twitterConsumerKey"); 110 | String twitterConsumerSecret = call.argument("twitterConsumerSecret"); 111 | 112 | 113 | JShareInterface.setDebugMode(isDebug); 114 | 115 | PlatformConfig platformConfig = new PlatformConfig(); 116 | platformConfig.setWechat(weChatAppId, weChatAppSecret); 117 | platformConfig.setQQ(qqAppId, qqAppKey); 118 | platformConfig.setSinaWeibo(sinaWeiboAppKey, sinaWeiboAppSecret, sinaRedirectUri); 119 | platformConfig.setFacebook(facebookAppID, facebookDisplayName); 120 | platformConfig.setTwitter(twitterConsumerKey, twitterConsumerSecret); 121 | 122 | JShareInterface.init(context, platformConfig); 123 | } 124 | 125 | private void isClientValid(MethodCall call, Result result) { 126 | Log.d(TAG, "Action - isClientValid:"); 127 | String para_platform = call.argument("platform"); 128 | final String platformName = JShareMessage.getPlatform(para_platform); 129 | boolean isValid = JShareInterface.isClientValid(platformName); 130 | 131 | final Map map = new HashMap<>(); 132 | map.put(j_code_key, isValid ? j_success_code : j_fail_code); 133 | map.put(j_msg_key, ""); 134 | 135 | runMainThread(map, result); 136 | } 137 | 138 | private void shareMessage(MethodCall call, final Result result) { 139 | Log.d(TAG, "Action - shareMessage:"); 140 | 141 | JShareMessage message = new JShareMessage((Map) call.arguments); 142 | if (message.platform == null) { 143 | return; 144 | } 145 | 146 | ShareParams shareParams = new ShareParams(); 147 | shareParams.setShareType(message.shareType); 148 | 149 | if (message.title != null) { 150 | shareParams.setTitle(message.title); 151 | } 152 | if (message.text != null) { 153 | shareParams.setText(message.text); 154 | } 155 | if (message.url != null) { 156 | shareParams.setUrl(message.url); 157 | } 158 | 159 | 160 | // 分享图片、emoji 表情、其他类型的缩略图 161 | if (message.imagePath != null) { 162 | shareParams.setImagePath(message.imagePath); 163 | } 164 | 165 | // 音乐源url 166 | if (message.musicDataUrl != null) { 167 | shareParams.setMusicUrl(message.musicDataUrl); 168 | } 169 | 170 | // 支持分享视频: 微信、QZone(本地视频)、FB(本地视频)、Twitter(本地视频) 171 | if (message.videoPath != null) { 172 | shareParams.setVideoPath(message.videoPath); 173 | } 174 | 175 | // 支持分享文件 : 微信(朋友圈、微信收藏不支持) 176 | if (message.platform == Wechat.Name) { 177 | if (message.fileDataPath != null) { 178 | shareParams.setFilePath(message.fileDataPath); 179 | } 180 | } 181 | 182 | // 分享小程序,支持分享小程序 : 微信(朋友圈、微信收藏不支持) 183 | if (message.shareType == Platform.SHARE_MINI_PROGRAM) { 184 | if (message.platform == Wechat.Name) { 185 | if (message.miniProgramPath != null) { 186 | shareParams.setMiniProgramPath(message.miniProgramPath); 187 | } 188 | if (message.miniProgramUserName != null) { 189 | shareParams.setMiniProgramUserName(message.miniProgramUserName); 190 | } 191 | if (message.miniProgramWithShareTicket != null) { 192 | shareParams.setMiniProgramWithShareTicket(message.miniProgramWithShareTicket); 193 | } 194 | if (message.imagePath != null) { 195 | shareParams.setMiniProgramImagePath(message.imagePath); 196 | } 197 | shareParams.setMiniProgramType(message.miniProgramType); 198 | } 199 | } 200 | 201 | JShareInterface.share(message.platform, shareParams, new PlatActionListener() { 202 | @Override 203 | public void onComplete(Platform platform, int action, HashMap hashMap) { 204 | Log.d(TAG, "Action - shareMessage - onComplete"); 205 | // 分享成功 206 | final Map map = new HashMap<>(); 207 | map.put(j_code_key, j_success_code); 208 | map.put(j_msg_key, "分享成功"); 209 | runMainThread(map, result); 210 | } 211 | 212 | @Override 213 | public void onError(Platform platform, int action, int errorCode, Throwable throwable) { 214 | Log.d(TAG, "Action - shareMessage - onError"); 215 | // 分享失败 216 | final Map map = new HashMap<>(); 217 | map.put(j_code_key, String.valueOf(errorCode)); 218 | map.put(j_msg_key, "分享失败"); 219 | runMainThread(map, result); 220 | } 221 | 222 | @Override 223 | public void onCancel(Platform platform, int action) { 224 | Log.d(TAG, "Action - shareMessage - onCancel"); 225 | // 分享取消 226 | final Map map = new HashMap<>(); 227 | map.put(j_code_key, j_cancel_code); 228 | map.put(j_msg_key, "分享取消"); 229 | runMainThread(map, result); 230 | } 231 | }); 232 | 233 | } 234 | 235 | private void authorize(MethodCall call, final Result result) { 236 | 237 | String para_platform = call.argument("platform"); 238 | final String platformName = JShareMessage.getPlatform(para_platform); 239 | 240 | JShareInterface.authorize(platformName, new AuthListener() { 241 | @Override 242 | public void onComplete(Platform platform, int action, BaseResponseInfo data) { 243 | Log.d(TAG, "onComplete:" + platform + ",action:" + action + ",data:" + data); 244 | final Map map = new HashMap<>(); 245 | map.put(j_code_key, j_success_code); 246 | 247 | String toastMsg = null; 248 | if (action == Platform.ACTION_AUTHORIZING) { 249 | if (data instanceof AccessTokenInfo) { //授权信息 250 | String token = ((AccessTokenInfo) data).getToken();//token 251 | long expiration = ((AccessTokenInfo) data).getExpiresIn();//token有效时间,时间戳 252 | String refresh_token = ((AccessTokenInfo) data).getRefeshToken();//refresh_token 253 | String openid = ((AccessTokenInfo) data).getOpenid();//openid 254 | 255 | //授权原始数据,开发者可自行处理 256 | String originData = data.getOriginData(); 257 | toastMsg = "授权成功:" + data.toString(); 258 | 259 | Log.d(TAG, "openid:" + openid + ",token:" + token + ",expiration:" + expiration + ",refresh_token:" + refresh_token); 260 | Log.d(TAG, "originData:" + originData); 261 | 262 | if (token != null) { 263 | map.put("token", token); 264 | } 265 | if (refresh_token != null) { 266 | map.put("refreshToken", refresh_token); 267 | } 268 | if (openid != null) { 269 | map.put("openid", openid); 270 | } 271 | if (originData != null) { 272 | map.put("originData", originData); 273 | } 274 | 275 | map.put("expiration", Long.toString(expiration)); 276 | } 277 | } 278 | runMainThread(map, result); 279 | } 280 | 281 | @Override 282 | public void onError(Platform platform, int action, int errorCode, Throwable throwable) { 283 | String toastMsg = null; 284 | if (action == Platform.ACTION_AUTHORIZING) { 285 | toastMsg = "授权失败"; 286 | } 287 | final Map map = new HashMap<>(); 288 | map.put(j_code_key, String.valueOf(errorCode)); 289 | map.put(j_msg_key, toastMsg); 290 | 291 | runMainThread(map, result); 292 | } 293 | 294 | @Override 295 | public void onCancel(Platform platform, int action) { 296 | Log.d(TAG, "onCancel:" + platform + ",action:" + action); 297 | String toastMsg = null; 298 | if (action == Platform.ACTION_AUTHORIZING) { 299 | toastMsg = "取消授权"; 300 | } 301 | 302 | final Map map = new HashMap<>(); 303 | map.put(j_code_key, j_cancel_code); 304 | map.put(j_msg_key, toastMsg); 305 | 306 | runMainThread(map, result); 307 | } 308 | }); 309 | } 310 | 311 | // 判断是否授权 312 | private void isPlatformAuth(MethodCall call, final Result result) { 313 | String platformName = call.argument("platform"); 314 | String platform = JShareMessage.getPlatform(platformName); 315 | boolean isAuth = JShareInterface.isAuthorize(platform); 316 | 317 | final Map map = new HashMap<>(); 318 | map.put(j_code_key, j_success_code); 319 | map.put(j_msg_key, isAuth ? "已经授权" : "未授权"); 320 | runMainThread(map, result); 321 | } 322 | 323 | ///取消授权 324 | private void cancelPlatformAuth(MethodCall call, final Result result) { 325 | String platformName = call.argument("platform"); 326 | String platform = JShareMessage.getPlatform(platformName); 327 | 328 | JShareInterface.removeAuthorize(platform, new AuthListener() { 329 | @Override 330 | public void onComplete(Platform platform, int action, BaseResponseInfo baseResponseInfo) { 331 | Log.d(TAG, "onComplete:" + platform + ",action:" + action + ",data:" + baseResponseInfo); 332 | String toastMsg = null; 333 | if (action == Platform.ACTION_REMOVE_AUTHORIZING) { 334 | toastMsg = "删除授权成功"; 335 | } 336 | 337 | final Map map = new HashMap<>(); 338 | map.put(j_code_key, j_success_code); 339 | map.put(j_msg_key, toastMsg); 340 | 341 | runMainThread(map, result); 342 | } 343 | 344 | @Override 345 | public void onError(Platform platform, int action, int errorCode, Throwable error) { 346 | Log.d(TAG, "onError:" + platform + ",action:" + action + ",error:" + error); 347 | String toastMsg = null; 348 | if (action == Platform.ACTION_REMOVE_AUTHORIZING) { 349 | toastMsg = "删除授权失败"; 350 | } 351 | 352 | final Map map = new HashMap<>(); 353 | map.put(j_code_key, String.valueOf(errorCode)); 354 | map.put(j_msg_key, toastMsg); 355 | 356 | runMainThread(map, result); 357 | } 358 | 359 | @Override 360 | public void onCancel(Platform platform, int action) { 361 | final Map map = new HashMap<>(); 362 | map.put(j_code_key, j_cancel_code); 363 | map.put(j_msg_key, "放弃取消授权"); 364 | 365 | runMainThread(map, result); 366 | } 367 | }); 368 | } 369 | 370 | // 获取个人信息 371 | private void getUserInfo(MethodCall call, final Result result) { 372 | String platformName = call.argument("platform"); 373 | String platform = JShareMessage.getPlatform(platformName); 374 | 375 | JShareInterface.getUserInfo(platform, new AuthListener() { 376 | @Override 377 | public void onComplete(Platform platform, int action, BaseResponseInfo info) { 378 | Log.d(TAG, "onComplete:" + platform + ",action:" + action + ",info:" + info); 379 | final Map map = new HashMap<>(); 380 | map.put(j_code_key, j_success_code); 381 | 382 | String toastMsg = null; 383 | if (action == Platform.ACTION_USER_INFO) { 384 | if (info instanceof UserInfo) { //第三方个人信息 385 | String openid = ((UserInfo) info).getOpenid(); //openid 386 | String name = ((UserInfo) info).getName(); //昵称 387 | String imageUrl = ((UserInfo) info).getImageUrl(); //头像url 388 | int gender = ((UserInfo) info).getGender();//性别, 1表示男性;2表示女性 389 | //个人信息原始数据,开发者可自行处理 390 | String originData = info.getOriginData(); 391 | toastMsg = "获取个人信息成功:" + info.toString(); 392 | Log.d(TAG, "openid:" + openid + ",name:" + name + ",gender:" + gender + ",imageUrl:" + imageUrl); 393 | Log.d(TAG, "originData:" + originData); 394 | 395 | if (openid != null) { 396 | map.put("openid", openid); 397 | } 398 | if (name != null) { 399 | map.put("name", name); 400 | } 401 | if (imageUrl != null) { 402 | map.put("imageUrl", imageUrl); 403 | } 404 | map.put("gender", gender); 405 | if (originData != null) { 406 | map.put("originData", originData); 407 | } 408 | } 409 | } 410 | runMainThread(map, result); 411 | } 412 | 413 | @Override 414 | public void onError(Platform platform, int action, int errorCode, Throwable error) { 415 | Log.d(TAG, "onError:" + platform + ",action:" + action + ",error:" + error); 416 | String toastMsg = null; 417 | if (action == Platform.ACTION_USER_INFO) { 418 | toastMsg = "获取个人信息失败"; 419 | } 420 | final Map map = new HashMap<>(); 421 | map.put(j_code_key, String.valueOf(errorCode)); 422 | map.put(j_msg_key, toastMsg); 423 | runMainThread(map, result); 424 | } 425 | 426 | @Override 427 | public void onCancel(Platform platform, int action) { 428 | Log.d(TAG, "onCancel:" + platform + ",action:" + action); 429 | String toastMsg = null; 430 | if (action == Platform.ACTION_USER_INFO) { 431 | toastMsg = "取消获取个人信息"; 432 | } 433 | final Map map = new HashMap<>(); 434 | map.put(j_code_key, j_cancel_code); 435 | map.put(j_msg_key, toastMsg); 436 | runMainThread(map, result); 437 | } 438 | }); 439 | } 440 | 441 | // 主线程再返回数据 442 | private void runMainThread(final Map map, final Result result) { 443 | Handler handler = new Handler(Looper.getMainLooper()); 444 | handler.post(new Runnable() { 445 | @Override 446 | public void run() { 447 | result.success(map); 448 | } 449 | }); 450 | } 451 | 452 | 453 | private Bitmap returnBitmapFromUrl(String url) { 454 | Log.d(TAG, "returnBitmapFromUrl: url = " + url); 455 | 456 | URL fileUrl = null; 457 | Bitmap bitmap = null; 458 | try { 459 | fileUrl = new URL(url); 460 | } catch (MalformedURLException e) { 461 | e.printStackTrace(); 462 | Log.d(TAG, "MalformedURLException ERROR:" + e); 463 | } 464 | 465 | try { 466 | HttpURLConnection connection = (HttpURLConnection) fileUrl.openConnection(); 467 | // connection.setDoInput(true); 468 | // connection.connect(); 469 | connection.setConnectTimeout(3000); 470 | Log.d(TAG, "download bitmap from url: - 1-" + connection.getResponseCode()); 471 | InputStream is = connection.getInputStream(); 472 | Log.d(TAG, "download bitmap from url: - 2-" + connection.getResponseCode()); 473 | 474 | bitmap = BitmapFactory.decodeStream(is); 475 | is.close(); 476 | } catch (IOException e) { 477 | e.printStackTrace(); 478 | Log.d(TAG, "IOException ERROR:" + e); 479 | } 480 | Log.d(TAG, "bitmap" + bitmap); 481 | return bitmap; 482 | } 483 | 484 | private Bitmap byte2Bitmap(byte[] b) { 485 | if (b.length != 0) { 486 | return BitmapFactory.decodeByteArray(b, 0, b.length); 487 | } else { 488 | return null; 489 | } 490 | } 491 | } 492 | -------------------------------------------------------------------------------- /documents/APIs.md: -------------------------------------------------------------------------------- 1 | ## 接口文档 2 | 3 | #### 初始化 4 | 5 | ``` 6 | JShare jShare = new JShare(); 7 | JShareConfig shareConfig = new JShareConfig(appKey: "ef4be2a0dec95dfd22402d45"); 8 | shareConfig.channel = "channel"; 9 | shareConfig.isDebug = true; 10 | shareConfig.isAdvertisinId = true; 11 | shareConfig.isProduction = true; 12 | 13 | shareConfig.weChatAppId = "wxc40e16f3ba6ebabc"; 14 | shareConfig.weChatAppSecret = "dcad950cd0633a27e353477c4ec12e7a"; 15 | 16 | shareConfig.qqAppId = "100424468"; 17 | shareConfig.qqAppKey = "glFYjkHQGSOCJHMC"; 18 | 19 | shareConfig.sinaWeiboAppKey = "374535501"; 20 | shareConfig.sinaWeiboAppSecret = "baccd12c166f1df96736b51ffbf600a2"; 21 | shareConfig.sinaRedirectUri = "https://www.jiguang.cn"; 22 | 23 | shareConfig.facebookAppID = "1847959632183996"; 24 | shareConfig.facebookDisplayName = "JShareDemo"; 25 | 26 | shareConfig.twitterConsumerKey = "4hCeIip1cpTk9oPYeCbYKhVWi"; 27 | shareConfig.twitterConsumerSecret = 28 | "DuIontT8KPSmO2Y1oAvby7tpbWHJimuakpbiAUHEKncbffekmC"; 29 | 30 | jShare.setup(config: shareConfig); 31 | 32 | ``` 33 | 34 | #### 分享 35 | 36 | ``` 37 | JShareMessage message = new JShareMessage(); 38 | message.mediaType = JShareType.text; 39 | message.platform = JSharePlatform.wechatSession; 40 | message.text = "jshare-text"; 41 | message.title = "jshare-title"; 42 | ···· 43 | 44 | jShare.shareMessage(message: message).then((JShareResponse response) { 45 | print("分享回调:" + response.toJsonMap().toString()); 46 | }).catchError((error) { 47 | print("分享回调 -- 出错:${error.toString()}"); 48 | }); 49 | 50 | ``` 51 | 52 | #### 授权 53 | 54 | ``` 55 | jShare.authorize(platform: JSharePlatform.wechatSession).then((JShareSocial value){ 56 | setState(() { 57 | _resultString = "授权:" + value.toJsonMap().toString(); 58 | }); 59 | }).catchError((error){ 60 | setState(() { 61 | _resultString = "授权:" + error.toString(); 62 | }); 63 | }); 64 | ``` 65 | 66 | #### 判断是否授权 67 | 68 | ``` 69 | jShare.isPlatformAuth(platform: JSharePlatform.wechatSession).then((JShareResponse response){ 70 | setState(() { 71 | _resultString = "是否授权:" + response.toJsonMap().toString(); 72 | }); 73 | }).catchError((error){ 74 | setState(() { 75 | _resultString = "是否授权:" + error.toString(); 76 | }); 77 | }); 78 | ``` 79 | 80 | #### 取消授权 81 | 82 | ``` 83 | jShare.cancelPlatformAuth(platform: JSharePlatform.wechatSession).then((JShareResponse response){ 84 | setState(() { 85 | _resultString = "取消授权:" + response.toJsonMap().toString(); 86 | }); 87 | }).catchError((error){ 88 | setState(() { 89 | _resultString = "取消授权:" + error.toString(); 90 | }); 91 | }); 92 | ``` 93 | 94 | #### 获取用户信息 95 | 96 | ``` 97 | jShare.getUserInfo(platform: JSharePlatform.wechatSession).then((JShareUserInfo info){ 98 | setState(() { 99 | _resultString = "获取用户信息:" + info.toJsonMap().toString(); 100 | }); 101 | }).catchError((error){ 102 | setState(() { 103 | _resultString = "获取用户信息:" + error.toString(); 104 | }); 105 | }); 106 | ``` 107 | 108 | #### 判断平台分享是否有效 109 | 110 | ``` 111 | bool isValid = await jShare.isClientValid(platform: JSharePlatform.wechatSession); 112 | ``` 113 | 114 | #### 基础类 115 | 116 | ##### 初始化配置类 117 | 初始化所必须的一些配置 118 | 119 | ``` 120 | /// 初始化配置 121 | class JShareConfig { 122 | bool isDebug = false; 123 | String channel; 124 | bool isAdvertisinId = false; 125 | bool isProduction = false; 126 | String appKey; // 极光平台 AppKey 127 | String weChatAppId; 128 | String weChatAppSecret; 129 | String qqAppId; 130 | String qqAppKey; 131 | String sinaWeiboAppKey; 132 | String sinaWeiboAppSecret; 133 | String sinaRedirectUri; 134 | String facebookAppID; 135 | String facebookDisplayName; 136 | String twitterConsumerKey; 137 | String twitterConsumerSecret; 138 | } 139 | ``` 140 | 141 | ##### 分享消息类 142 | 分享内容都将封装成 JShareMessage 类型,注意每个平台所支持的分享内容不同。 143 | 144 | ``` 145 | class JShareMessage { 146 | /// 标题:长度每个平台的限制而不同 147 | String title; 148 | /// 文本:文本内容,长度每个平台的限制而不同。在分享非文本类型时,此字段作为分享内容的描述使用 149 | String text; 150 | /// 链接:根据媒体类型填入链接,长度每个平台的限制不同。分享非文本及非图片类型时,必要!(音乐跳转url、视频url、网页url) 151 | String url; 152 | /// 图片路径 153 | String imagePath; 154 | /// 本地视频:仅支持 QZone、Twitter、Facebook、Facebook Messenger, iOS 端要传 ALAsset的ALAssetPropertyAssetURL; 其他平台通过 url 分享视频 155 | String videoPath; 156 | /// 分享 music 类型至微信平台或QQ平台时,音乐数据源url,点击可直接播放。 157 | String musicDataUrl; 158 | 159 | /// 分享 App 类型至微信平台时,第三方程序自定义的简单数据,only for ios 160 | String extInfo; 161 | /// 分享 File 或者 App 类型时,对应的File数据以及App数据,最大 10 M 162 | String fileDataPath; 163 | /// 分享 File 类型至微信平台时,对应的文件后缀名,分享文件必填,否则会导致分享到微信平台出现不一致的文件类型,最大 64 字符,only for ios 164 | String fileExt; 165 | 166 | /// 分享 Emoticon 类型至微信平台时,对应的表情数据,最大 10 M 167 | String emoticonDataPath; 168 | /// 分享至新浪微博平台时,分享参数的一个标识符,默认为 “objectId”。最大 255 字符 169 | String sinaObjectID; 170 | /// 微信小程序: 小程序username,如"gh_d43f693ca31f" 171 | String miniProgramUserName; 172 | /// 微信小程序: 小程序页面路径,如"pages/page10000/page10000" 173 | String miniProgramPath; 174 | /// 微信小程序: 小程序版本类型。 0正式版,1开发版,2体验版。默认0,正式版 175 | int miniProgramType = 0; 176 | /// 微信小程序: 是否使用带 shareTicket 的转发。默认false,不使用带 shareTicket 的转发 177 | bool miniProgramWithShareTicket = false; 178 | 179 | /// 分享的媒体类型。必要! 180 | JShareType mediaType; 181 | /// 分享的目标平台。必要! 182 | JSharePlatform platform; 183 | } 184 | ``` 185 | ##### 接口响应类 186 | 187 | ``` 188 | class JShareResponse { 189 | JShareCode code;/// 状态码 190 | String message; /// 返回提示 191 | } 192 | ``` 193 | 194 | ##### 平台授权信息类 195 | 继承于 `JShareResponse ` 196 | 197 | ``` 198 | class JShareSocial extends JShareResponse { 199 | String openid; 200 | String token; 201 | String refreshToken; 202 | String expiration; 203 | Map originData ; 204 | } 205 | ``` 206 | 207 | ##### 平台用户信息类 208 | 继承于 `JShareResponse ` 209 | 210 | ``` 211 | class JShareUserInfo extends JShareSocial { 212 | String name; 213 | String imageUrl; 214 | int gender; 215 | } 216 | ``` -------------------------------------------------------------------------------- /example/.flutter-plugins-dependencies: -------------------------------------------------------------------------------- 1 | {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"jshare_flutter_plugin","path":"D:\\\\Workspace\\\\flutter\\\\jshare-flutter-plugin\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\Workspace\\\\android\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-2.0.1\\\\","dependencies":[]}],"android":[{"name":"jshare_flutter_plugin","path":"D:\\\\Workspace\\\\flutter\\\\jshare-flutter-plugin\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\Workspace\\\\android\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-2.0.1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"D:\\\\Workspace\\\\android\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\Workspace\\\\android\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\Workspace\\\\android\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_windows-2.0.0\\\\","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"jshare_flutter_plugin","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-05-25 14:45:14.977841","version":"2.2.0"} -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .packages 28 | .pub-cache/ 29 | .pub/ 30 | /build/ 31 | 32 | # Android related 33 | **/android/**/gradle-wrapper.jar 34 | **/android/.gradle 35 | **/android/captures/ 36 | **/android/gradlew 37 | **/android/gradlew.bat 38 | **/android/local.properties 39 | **/android/**/GeneratedPluginRegistrant.java 40 | 41 | # iOS/XCode related 42 | **/ios/**/*.mode1v3 43 | **/ios/**/*.mode2v3 44 | **/ios/**/*.moved-aside 45 | **/ios/**/*.pbxuser 46 | **/ios/**/*.perspectivev3 47 | **/ios/**/*sync/ 48 | **/ios/**/.sconsign.dblite 49 | **/ios/**/.tags* 50 | **/ios/**/.vagrant/ 51 | **/ios/**/DerivedData/ 52 | **/ios/**/Icon? 53 | **/ios/**/Pods/ 54 | **/ios/**/.symlinks/ 55 | **/ios/**/profile 56 | **/ios/**/xcuserdata 57 | **/ios/.generated/ 58 | **/ios/Flutter/App.framework 59 | **/ios/Flutter/Flutter.framework 60 | **/ios/Flutter/Generated.xcconfig 61 | **/ios/Flutter/app.flx 62 | **/ios/Flutter/app.zip 63 | **/ios/Flutter/flutter_assets/ 64 | **/ios/Flutter/flutter_export_environment.sh 65 | **/ios/ServiceDefinitions.json 66 | **/ios/Runner/GeneratedPluginRegistrant.* 67 | 68 | # Exceptions to above rules. 69 | !**/ios/**/default.mode1v3 70 | !**/ios/**/default.mode2v3 71 | !**/ios/**/default.pbxuser 72 | !**/ios/**/default.perspectivev3 73 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 74 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 68587a0916366e9512a78df22c44163d041dd5f3 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # jshare_flutter_plugin_example 2 | 3 | Demonstrates how to use the jshare_flutter_plugin plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "cn.jiguang.share.demo"//包名 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | 42 | ndk { 43 | //选择要添加的对应 cpu 类型的 .so 库。 44 | abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a' 45 | // 还可以添加 46 | } 47 | 48 | manifestPlaceholders = [ 49 | JSHARE_PKGNAME : applicationId, 50 | JPUSH_APPKEY : "JIGUANG AppKey", //极光 上注册的包名对应的 Appkey. 51 | JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可. 52 | TENCENT_APPID : "tencent appid",//腾讯开放平台注册应用得到的appId 53 | FACEBOOK_APPID : "facebook appid",//facebook注册应用得到的appId 54 | ] 55 | } 56 | 57 | signingConfigs { 58 | //应用的包名、应用的签名、第三方平台注册的AppID及Appkey三者要一一对应,否则会无法分享 59 | debug { 60 | storeFile file("jshare.jks") 61 | storePassword "sdkteam" 62 | keyAlias "jshare" 63 | keyPassword "sdkteam" 64 | } 65 | } 66 | buildTypes { 67 | release { 68 | shrinkResources false 69 | minifyEnabled false 70 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt' 71 | signingConfig signingConfigs.debug 72 | } 73 | debug { 74 | shrinkResources false 75 | minifyEnabled false 76 | signingConfig signingConfigs.debug 77 | } 78 | } 79 | } 80 | 81 | flutter { 82 | source '../..' 83 | } 84 | -------------------------------------------------------------------------------- /example/android/app/jshare.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/android/app/jshare.jks -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 10 | 16 | 23 | 27 | 31 | 36 | 40 | 41 | 42 | 43 | 44 | 45 | 47 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 71 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/cn/jiguang/jshare_flutter_plugin_example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package cn.jiguang.jshare_flutter_plugin_example; 2 | 3 | import io.flutter.embedding.android.FlutterActivity; 4 | 5 | public class MainActivity extends FlutterActivity { 6 | } 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/cn/jiguang/share/demo/wxapi/WXEntryActivity.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package cn.jiguang.share.demo.wxapi; 4 | 5 | 6 | import android.content.Intent; 7 | import android.os.Bundle; 8 | import cn.jiguang.share.wechat.WeChatHandleActivity; 9 | 10 | /** 微信客户端回调activity示例 */ 11 | public class WXEntryActivity extends WeChatHandleActivity { 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | } 16 | 17 | @Override 18 | protected void onNewIntent(Intent intent) { 19 | super.onNewIntent(intent); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/xml/jshare_file_provider_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:4.1.2' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useDeprecatedNdk=true 3 | #android.enableR8=true 4 | android.useAndroidX=true 5 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Apr 23 13:56:32 CST 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/assets/images/icon_jiguang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/assets/images/icon_jiguang.png -------------------------------------------------------------------------------- /example/assets/images/jiguang_socialize_cp_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/assets/images/jiguang_socialize_cp_link.png -------------------------------------------------------------------------------- /example/assets/images/jiguang_socialize_facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/assets/images/jiguang_socialize_facebook.png -------------------------------------------------------------------------------- /example/assets/images/jiguang_socialize_menu_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/assets/images/jiguang_socialize_menu_default.png -------------------------------------------------------------------------------- /example/assets/images/jiguang_socialize_messenger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/assets/images/jiguang_socialize_messenger.png -------------------------------------------------------------------------------- /example/assets/images/jiguang_socialize_qq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/assets/images/jiguang_socialize_qq.png -------------------------------------------------------------------------------- /example/assets/images/jiguang_socialize_qzone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/assets/images/jiguang_socialize_qzone.png -------------------------------------------------------------------------------- /example/assets/images/jiguang_socialize_sina.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/assets/images/jiguang_socialize_sina.png -------------------------------------------------------------------------------- /example/assets/images/jiguang_socialize_twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/assets/images/jiguang_socialize_twitter.png -------------------------------------------------------------------------------- /example/assets/images/jiguang_socialize_wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/assets/images/jiguang_socialize_wechat.png -------------------------------------------------------------------------------- /example/assets/images/jiguang_socialize_wxfavorite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/assets/images/jiguang_socialize_wxfavorite.png -------------------------------------------------------------------------------- /example/assets/images/jiguang_socialize_wxtimeLine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/assets/images/jiguang_socialize_wxtimeLine.png -------------------------------------------------------------------------------- /example/ios/Flutter/.last_build_id: -------------------------------------------------------------------------------- 1 | 3f6a8d6239336ad22e17db83aed41705 -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Flutter.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: This podspec is NOT to be published. It is only used as a local source! 3 | # 4 | 5 | Pod::Spec.new do |s| 6 | s.name = 'Flutter' 7 | s.version = '1.0.0' 8 | s.summary = 'High-performance, high-fidelity mobile apps.' 9 | s.description = <<-DESC 10 | Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS. 11 | DESC 12 | s.homepage = 'https://flutter.io' 13 | s.license = { :type => 'MIT' } 14 | s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } 15 | s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } 16 | s.ios.deployment_target = '8.0' 17 | s.vendored_frameworks = 'Flutter.framework' 18 | end 19 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def parse_KV_file(file, separator='=') 14 | file_abs_path = File.expand_path(file) 15 | if !File.exists? file_abs_path 16 | return []; 17 | end 18 | pods_ary = [] 19 | skip_line_start_symbols = ["#", "/"] 20 | File.foreach(file_abs_path) { |line| 21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 22 | plugin = line.split(pattern=separator) 23 | if plugin.length == 2 24 | podname = plugin[0].strip() 25 | path = plugin[1].strip() 26 | podpath = File.expand_path("#{path}", file_abs_path) 27 | pods_ary.push({:name => podname, :path => podpath}); 28 | else 29 | puts "Invalid plugin specification: #{line}" 30 | end 31 | } 32 | return pods_ary 33 | end 34 | 35 | target 'Runner' do 36 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 37 | # referring to absolute paths on developers' machines. 38 | system('rm -rf .symlinks') 39 | system('mkdir -p .symlinks/plugins') 40 | 41 | # Flutter Pods 42 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') 43 | if generated_xcode_build_settings.empty? 44 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first." 45 | end 46 | generated_xcode_build_settings.map { |p| 47 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR' 48 | symlink = File.join('.symlinks', 'flutter') 49 | File.symlink(File.dirname(p[:path]), symlink) 50 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) 51 | end 52 | } 53 | 54 | # Plugin Pods 55 | plugin_pods = parse_KV_file('../.flutter-plugins') 56 | plugin_pods.map { |p| 57 | symlink = File.join('.symlinks', 'plugins', p[:name]) 58 | File.symlink(p[:path], symlink) 59 | pod p[:name], :path => File.join(symlink, 'ios') 60 | } 61 | end 62 | 63 | # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. 64 | install! 'cocoapods', :disable_input_output_paths => true 65 | 66 | post_install do |installer| 67 | installer.pods_project.targets.each do |target| 68 | target.build_configurations.each do |config| 69 | config.build_settings['ENABLE_BITCODE'] = 'NO' 70 | end 71 | end 72 | end 73 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - JCore (2.4.0) 4 | - JShare (1.9.1): 5 | - JCore (< 3.0.0, >= 1.2.0) 6 | - jshare_flutter_plugin (0.0.1): 7 | - Flutter 8 | - JShare 9 | - path_provider (0.0.1): 10 | - Flutter 11 | 12 | DEPENDENCIES: 13 | - Flutter (from `.symlinks/flutter/ios`) 14 | - jshare_flutter_plugin (from `.symlinks/plugins/jshare_flutter_plugin/ios`) 15 | - path_provider (from `.symlinks/plugins/path_provider/ios`) 16 | 17 | SPEC REPOS: 18 | trunk: 19 | - JCore 20 | - JShare 21 | 22 | EXTERNAL SOURCES: 23 | Flutter: 24 | :path: ".symlinks/flutter/ios" 25 | jshare_flutter_plugin: 26 | :path: ".symlinks/plugins/jshare_flutter_plugin/ios" 27 | path_provider: 28 | :path: ".symlinks/plugins/path_provider/ios" 29 | 30 | SPEC CHECKSUMS: 31 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec 32 | JCore: a29e4b0ee54e1301446dc02d8e1c350404108b34 33 | JShare: f8af6e61c9f56645735d3c96aa60ce7766762eb5 34 | jshare_flutter_plugin: 89b748afa0ab48e319082a897ed08c484194d830 35 | path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d 36 | 37 | PODFILE CHECKSUM: 7fb83752f59ead6285236625b82473f90b1cb932 38 | 39 | COCOAPODS: 1.9.3 40 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 66A7C3C2565662E29546DB1D /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 68E78CD19A71B53CB99189E8 /* libPods-Runner.a */; }; 13 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 14 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 15 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 16 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 17 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 18 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXCopyFilesBuildPhase section */ 22 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 23 | isa = PBXCopyFilesBuildPhase; 24 | buildActionMask = 2147483647; 25 | dstPath = ""; 26 | dstSubfolderSpec = 10; 27 | files = ( 28 | ); 29 | name = "Embed Frameworks"; 30 | runOnlyForDeploymentPostprocessing = 0; 31 | }; 32 | /* End PBXCopyFilesBuildPhase section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 36 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 37 | 1F237D8DBF5E6401AB9E4502 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 38 | 39AA603A2A8A311C3CF3AD12 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 39 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 40 | 6544430829AA8C1395798B15 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 41 | 68E78CD19A71B53CB99189E8 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 43 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 44 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 45 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 46 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 47 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 49 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 51 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 52 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | 66A7C3C2565662E29546DB1D /* libPods-Runner.a in Frameworks */, 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | /* End PBXFrameworksBuildPhase section */ 65 | 66 | /* Begin PBXGroup section */ 67 | 4558E70B88B03B0CCEEBB268 /* Pods */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 1F237D8DBF5E6401AB9E4502 /* Pods-Runner.debug.xcconfig */, 71 | 39AA603A2A8A311C3CF3AD12 /* Pods-Runner.release.xcconfig */, 72 | 6544430829AA8C1395798B15 /* Pods-Runner.profile.xcconfig */, 73 | ); 74 | path = Pods; 75 | sourceTree = ""; 76 | }; 77 | 68A72ADE96F37C05C8553489 /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 68E78CD19A71B53CB99189E8 /* libPods-Runner.a */, 81 | ); 82 | name = Frameworks; 83 | sourceTree = ""; 84 | }; 85 | 9740EEB11CF90186004384FC /* Flutter */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 89 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 90 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 91 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 92 | ); 93 | name = Flutter; 94 | sourceTree = ""; 95 | }; 96 | 97C146E51CF9000F007C117D = { 97 | isa = PBXGroup; 98 | children = ( 99 | 9740EEB11CF90186004384FC /* Flutter */, 100 | 97C146F01CF9000F007C117D /* Runner */, 101 | 97C146EF1CF9000F007C117D /* Products */, 102 | 4558E70B88B03B0CCEEBB268 /* Pods */, 103 | 68A72ADE96F37C05C8553489 /* Frameworks */, 104 | ); 105 | sourceTree = ""; 106 | }; 107 | 97C146EF1CF9000F007C117D /* Products */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 97C146EE1CF9000F007C117D /* Runner.app */, 111 | ); 112 | name = Products; 113 | sourceTree = ""; 114 | }; 115 | 97C146F01CF9000F007C117D /* Runner */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 119 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 120 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 121 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 122 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 123 | 97C147021CF9000F007C117D /* Info.plist */, 124 | 97C146F11CF9000F007C117D /* Supporting Files */, 125 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 126 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 127 | ); 128 | path = Runner; 129 | sourceTree = ""; 130 | }; 131 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 97C146F21CF9000F007C117D /* main.m */, 135 | ); 136 | name = "Supporting Files"; 137 | sourceTree = ""; 138 | }; 139 | /* End PBXGroup section */ 140 | 141 | /* Begin PBXNativeTarget section */ 142 | 97C146ED1CF9000F007C117D /* Runner */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 145 | buildPhases = ( 146 | 0518E86BED4A955AFC4BA348 /* [CP] Check Pods Manifest.lock */, 147 | 9740EEB61CF901F6004384FC /* Run Script */, 148 | 97C146EA1CF9000F007C117D /* Sources */, 149 | 97C146EB1CF9000F007C117D /* Frameworks */, 150 | 97C146EC1CF9000F007C117D /* Resources */, 151 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 152 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 153 | CB8A20E05DE8920C372E53B0 /* [CP] Embed Pods Frameworks */, 154 | ); 155 | buildRules = ( 156 | ); 157 | dependencies = ( 158 | ); 159 | name = Runner; 160 | productName = Runner; 161 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 162 | productType = "com.apple.product-type.application"; 163 | }; 164 | /* End PBXNativeTarget section */ 165 | 166 | /* Begin PBXProject section */ 167 | 97C146E61CF9000F007C117D /* Project object */ = { 168 | isa = PBXProject; 169 | attributes = { 170 | LastUpgradeCheck = 1020; 171 | ORGANIZATIONNAME = "The Chromium Authors"; 172 | TargetAttributes = { 173 | 97C146ED1CF9000F007C117D = { 174 | CreatedOnToolsVersion = 7.3.1; 175 | DevelopmentTeam = 8X2A38Q9VD; 176 | ProvisioningStyle = Manual; 177 | }; 178 | }; 179 | }; 180 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 181 | compatibilityVersion = "Xcode 3.2"; 182 | developmentRegion = en; 183 | hasScannedForEncodings = 0; 184 | knownRegions = ( 185 | en, 186 | Base, 187 | ); 188 | mainGroup = 97C146E51CF9000F007C117D; 189 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 190 | projectDirPath = ""; 191 | projectRoot = ""; 192 | targets = ( 193 | 97C146ED1CF9000F007C117D /* Runner */, 194 | ); 195 | }; 196 | /* End PBXProject section */ 197 | 198 | /* Begin PBXResourcesBuildPhase section */ 199 | 97C146EC1CF9000F007C117D /* Resources */ = { 200 | isa = PBXResourcesBuildPhase; 201 | buildActionMask = 2147483647; 202 | files = ( 203 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 204 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 205 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 206 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 207 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 208 | ); 209 | runOnlyForDeploymentPostprocessing = 0; 210 | }; 211 | /* End PBXResourcesBuildPhase section */ 212 | 213 | /* Begin PBXShellScriptBuildPhase section */ 214 | 0518E86BED4A955AFC4BA348 /* [CP] Check Pods Manifest.lock */ = { 215 | isa = PBXShellScriptBuildPhase; 216 | buildActionMask = 2147483647; 217 | files = ( 218 | ); 219 | inputFileListPaths = ( 220 | ); 221 | inputPaths = ( 222 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 223 | "${PODS_ROOT}/Manifest.lock", 224 | ); 225 | name = "[CP] Check Pods Manifest.lock"; 226 | outputFileListPaths = ( 227 | ); 228 | outputPaths = ( 229 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | shellPath = /bin/sh; 233 | 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"; 234 | showEnvVarsInLog = 0; 235 | }; 236 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 237 | isa = PBXShellScriptBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | ); 241 | inputPaths = ( 242 | ); 243 | name = "Thin Binary"; 244 | outputPaths = ( 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | shellPath = /bin/sh; 248 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 249 | }; 250 | 9740EEB61CF901F6004384FC /* Run Script */ = { 251 | isa = PBXShellScriptBuildPhase; 252 | buildActionMask = 2147483647; 253 | files = ( 254 | ); 255 | inputPaths = ( 256 | ); 257 | name = "Run Script"; 258 | outputPaths = ( 259 | ); 260 | runOnlyForDeploymentPostprocessing = 0; 261 | shellPath = /bin/sh; 262 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 263 | }; 264 | CB8A20E05DE8920C372E53B0 /* [CP] Embed Pods Frameworks */ = { 265 | isa = PBXShellScriptBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | ); 269 | inputPaths = ( 270 | ); 271 | name = "[CP] Embed Pods Frameworks"; 272 | outputPaths = ( 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | shellPath = /bin/sh; 276 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 277 | showEnvVarsInLog = 0; 278 | }; 279 | /* End PBXShellScriptBuildPhase section */ 280 | 281 | /* Begin PBXSourcesBuildPhase section */ 282 | 97C146EA1CF9000F007C117D /* Sources */ = { 283 | isa = PBXSourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 287 | 97C146F31CF9000F007C117D /* main.m in Sources */, 288 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | /* End PBXSourcesBuildPhase section */ 293 | 294 | /* Begin PBXVariantGroup section */ 295 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 296 | isa = PBXVariantGroup; 297 | children = ( 298 | 97C146FB1CF9000F007C117D /* Base */, 299 | ); 300 | name = Main.storyboard; 301 | sourceTree = ""; 302 | }; 303 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 304 | isa = PBXVariantGroup; 305 | children = ( 306 | 97C147001CF9000F007C117D /* Base */, 307 | ); 308 | name = LaunchScreen.storyboard; 309 | sourceTree = ""; 310 | }; 311 | /* End PBXVariantGroup section */ 312 | 313 | /* Begin XCBuildConfiguration section */ 314 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 315 | isa = XCBuildConfiguration; 316 | buildSettings = { 317 | ALWAYS_SEARCH_USER_PATHS = NO; 318 | CLANG_ANALYZER_NONNULL = YES; 319 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 320 | CLANG_CXX_LIBRARY = "libc++"; 321 | CLANG_ENABLE_MODULES = YES; 322 | CLANG_ENABLE_OBJC_ARC = YES; 323 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 324 | CLANG_WARN_BOOL_CONVERSION = YES; 325 | CLANG_WARN_COMMA = YES; 326 | CLANG_WARN_CONSTANT_CONVERSION = YES; 327 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 328 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 329 | CLANG_WARN_EMPTY_BODY = YES; 330 | CLANG_WARN_ENUM_CONVERSION = YES; 331 | CLANG_WARN_INFINITE_RECURSION = YES; 332 | CLANG_WARN_INT_CONVERSION = YES; 333 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 334 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 335 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 336 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 337 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 338 | CLANG_WARN_STRICT_PROTOTYPES = YES; 339 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 340 | CLANG_WARN_UNREACHABLE_CODE = YES; 341 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 342 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 343 | COPY_PHASE_STRIP = NO; 344 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 345 | ENABLE_NS_ASSERTIONS = NO; 346 | ENABLE_STRICT_OBJC_MSGSEND = YES; 347 | GCC_C_LANGUAGE_STANDARD = gnu99; 348 | GCC_NO_COMMON_BLOCKS = YES; 349 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 350 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 351 | GCC_WARN_UNDECLARED_SELECTOR = YES; 352 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 353 | GCC_WARN_UNUSED_FUNCTION = YES; 354 | GCC_WARN_UNUSED_VARIABLE = YES; 355 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 356 | MTL_ENABLE_DEBUG_INFO = NO; 357 | SDKROOT = iphoneos; 358 | TARGETED_DEVICE_FAMILY = "1,2"; 359 | VALIDATE_PRODUCT = YES; 360 | }; 361 | name = Profile; 362 | }; 363 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 364 | isa = XCBuildConfiguration; 365 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 366 | buildSettings = { 367 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 368 | CODE_SIGN_STYLE = Manual; 369 | CURRENT_PROJECT_VERSION = 1; 370 | DEVELOPMENT_TEAM = 8X2A38Q9VD; 371 | ENABLE_BITCODE = NO; 372 | FRAMEWORK_SEARCH_PATHS = ( 373 | "$(inherited)", 374 | "$(PROJECT_DIR)/Flutter", 375 | ); 376 | INFOPLIST_FILE = Runner/Info.plist; 377 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 378 | LIBRARY_SEARCH_PATHS = ( 379 | "$(inherited)", 380 | "$(PROJECT_DIR)/Flutter", 381 | ); 382 | MARKETING_VERSION = 1; 383 | PRODUCT_BUNDLE_IDENTIFIER = HeXunHuaGu.JSHAREDemo; 384 | PRODUCT_NAME = "$(TARGET_NAME)"; 385 | PROVISIONING_PROFILE_SPECIFIER = "HeXunHuaGu.JSHAREDemo-dev"; 386 | VERSIONING_SYSTEM = "apple-generic"; 387 | }; 388 | name = Profile; 389 | }; 390 | 97C147031CF9000F007C117D /* Debug */ = { 391 | isa = XCBuildConfiguration; 392 | buildSettings = { 393 | ALWAYS_SEARCH_USER_PATHS = NO; 394 | CLANG_ANALYZER_NONNULL = YES; 395 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 396 | CLANG_CXX_LIBRARY = "libc++"; 397 | CLANG_ENABLE_MODULES = YES; 398 | CLANG_ENABLE_OBJC_ARC = YES; 399 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 400 | CLANG_WARN_BOOL_CONVERSION = YES; 401 | CLANG_WARN_COMMA = YES; 402 | CLANG_WARN_CONSTANT_CONVERSION = YES; 403 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 404 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 405 | CLANG_WARN_EMPTY_BODY = YES; 406 | CLANG_WARN_ENUM_CONVERSION = YES; 407 | CLANG_WARN_INFINITE_RECURSION = YES; 408 | CLANG_WARN_INT_CONVERSION = YES; 409 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 410 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 411 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 412 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 413 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 414 | CLANG_WARN_STRICT_PROTOTYPES = YES; 415 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 416 | CLANG_WARN_UNREACHABLE_CODE = YES; 417 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 418 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 419 | COPY_PHASE_STRIP = NO; 420 | DEBUG_INFORMATION_FORMAT = dwarf; 421 | ENABLE_STRICT_OBJC_MSGSEND = YES; 422 | ENABLE_TESTABILITY = YES; 423 | GCC_C_LANGUAGE_STANDARD = gnu99; 424 | GCC_DYNAMIC_NO_PIC = NO; 425 | GCC_NO_COMMON_BLOCKS = YES; 426 | GCC_OPTIMIZATION_LEVEL = 0; 427 | GCC_PREPROCESSOR_DEFINITIONS = ( 428 | "DEBUG=1", 429 | "$(inherited)", 430 | ); 431 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 432 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 433 | GCC_WARN_UNDECLARED_SELECTOR = YES; 434 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 435 | GCC_WARN_UNUSED_FUNCTION = YES; 436 | GCC_WARN_UNUSED_VARIABLE = YES; 437 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 438 | MTL_ENABLE_DEBUG_INFO = YES; 439 | ONLY_ACTIVE_ARCH = YES; 440 | SDKROOT = iphoneos; 441 | TARGETED_DEVICE_FAMILY = "1,2"; 442 | }; 443 | name = Debug; 444 | }; 445 | 97C147041CF9000F007C117D /* Release */ = { 446 | isa = XCBuildConfiguration; 447 | buildSettings = { 448 | ALWAYS_SEARCH_USER_PATHS = NO; 449 | CLANG_ANALYZER_NONNULL = YES; 450 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 451 | CLANG_CXX_LIBRARY = "libc++"; 452 | CLANG_ENABLE_MODULES = YES; 453 | CLANG_ENABLE_OBJC_ARC = YES; 454 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 455 | CLANG_WARN_BOOL_CONVERSION = YES; 456 | CLANG_WARN_COMMA = YES; 457 | CLANG_WARN_CONSTANT_CONVERSION = YES; 458 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 459 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 460 | CLANG_WARN_EMPTY_BODY = YES; 461 | CLANG_WARN_ENUM_CONVERSION = YES; 462 | CLANG_WARN_INFINITE_RECURSION = YES; 463 | CLANG_WARN_INT_CONVERSION = YES; 464 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 465 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 466 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 467 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 468 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 469 | CLANG_WARN_STRICT_PROTOTYPES = YES; 470 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 471 | CLANG_WARN_UNREACHABLE_CODE = YES; 472 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 473 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 474 | COPY_PHASE_STRIP = NO; 475 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 476 | ENABLE_NS_ASSERTIONS = NO; 477 | ENABLE_STRICT_OBJC_MSGSEND = YES; 478 | GCC_C_LANGUAGE_STANDARD = gnu99; 479 | GCC_NO_COMMON_BLOCKS = YES; 480 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 481 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 482 | GCC_WARN_UNDECLARED_SELECTOR = YES; 483 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 484 | GCC_WARN_UNUSED_FUNCTION = YES; 485 | GCC_WARN_UNUSED_VARIABLE = YES; 486 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 487 | MTL_ENABLE_DEBUG_INFO = NO; 488 | SDKROOT = iphoneos; 489 | TARGETED_DEVICE_FAMILY = "1,2"; 490 | VALIDATE_PRODUCT = YES; 491 | }; 492 | name = Release; 493 | }; 494 | 97C147061CF9000F007C117D /* Debug */ = { 495 | isa = XCBuildConfiguration; 496 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 497 | buildSettings = { 498 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 499 | CODE_SIGN_STYLE = Manual; 500 | CURRENT_PROJECT_VERSION = 1; 501 | DEVELOPMENT_TEAM = 8X2A38Q9VD; 502 | ENABLE_BITCODE = NO; 503 | FRAMEWORK_SEARCH_PATHS = ( 504 | "$(inherited)", 505 | "$(PROJECT_DIR)/Flutter", 506 | ); 507 | INFOPLIST_FILE = Runner/Info.plist; 508 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 509 | LIBRARY_SEARCH_PATHS = ( 510 | "$(inherited)", 511 | "$(PROJECT_DIR)/Flutter", 512 | ); 513 | MARKETING_VERSION = 1; 514 | PRODUCT_BUNDLE_IDENTIFIER = HeXunHuaGu.JSHAREDemo; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | PROVISIONING_PROFILE_SPECIFIER = "HeXunHuaGu.JSHAREDemo-dev"; 517 | VERSIONING_SYSTEM = "apple-generic"; 518 | }; 519 | name = Debug; 520 | }; 521 | 97C147071CF9000F007C117D /* Release */ = { 522 | isa = XCBuildConfiguration; 523 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 524 | buildSettings = { 525 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 526 | CODE_SIGN_STYLE = Manual; 527 | CURRENT_PROJECT_VERSION = 1; 528 | DEVELOPMENT_TEAM = 8X2A38Q9VD; 529 | ENABLE_BITCODE = NO; 530 | FRAMEWORK_SEARCH_PATHS = ( 531 | "$(inherited)", 532 | "$(PROJECT_DIR)/Flutter", 533 | ); 534 | INFOPLIST_FILE = Runner/Info.plist; 535 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 536 | LIBRARY_SEARCH_PATHS = ( 537 | "$(inherited)", 538 | "$(PROJECT_DIR)/Flutter", 539 | ); 540 | MARKETING_VERSION = 1; 541 | PRODUCT_BUNDLE_IDENTIFIER = HeXunHuaGu.JSHAREDemo; 542 | PRODUCT_NAME = "$(TARGET_NAME)"; 543 | PROVISIONING_PROFILE_SPECIFIER = "HeXunHuaGu.JSHAREDemo-dev"; 544 | VERSIONING_SYSTEM = "apple-generic"; 545 | }; 546 | name = Release; 547 | }; 548 | /* End XCBuildConfiguration section */ 549 | 550 | /* Begin XCConfigurationList section */ 551 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 552 | isa = XCConfigurationList; 553 | buildConfigurations = ( 554 | 97C147031CF9000F007C117D /* Debug */, 555 | 97C147041CF9000F007C117D /* Release */, 556 | 249021D3217E4FDB00AE95B9 /* Profile */, 557 | ); 558 | defaultConfigurationIsVisible = 0; 559 | defaultConfigurationName = Release; 560 | }; 561 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 562 | isa = XCConfigurationList; 563 | buildConfigurations = ( 564 | 97C147061CF9000F007C117D /* Debug */, 565 | 97C147071CF9000F007C117D /* Release */, 566 | 249021D4217E4FDB00AE95B9 /* Profile */, 567 | ); 568 | defaultConfigurationIsVisible = 0; 569 | defaultConfigurationName = Release; 570 | }; 571 | /* End XCConfigurationList section */ 572 | }; 573 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 574 | } 575 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | jshare_flutter_plugin_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleSignature 20 | ???? 21 | CFBundleURLTypes 22 | 23 | 24 | CFBundleTypeRole 25 | Editor 26 | CFBundleURLName 27 | facebook 28 | CFBundleURLSchemes 29 | 30 | fb1847959632183996 31 | 32 | 33 | 34 | CFBundleTypeRole 35 | Editor 36 | CFBundleURLName 37 | QQ 38 | CFBundleURLSchemes 39 | 40 | tencent100424468 41 | 42 | 43 | 44 | CFBundleTypeRole 45 | Editor 46 | CFBundleURLName 47 | weixin 48 | CFBundleURLSchemes 49 | 50 | wxc40e16f3ba6ebabc 51 | 52 | 53 | 54 | CFBundleTypeRole 55 | Editor 56 | CFBundleURLName 57 | com.sina 58 | CFBundleURLSchemes 59 | 60 | wb374535501 61 | 62 | 63 | 64 | CFBundleTypeRole 65 | Editor 66 | CFBundleURLName 67 | Twitter 68 | CFBundleURLSchemes 69 | 70 | twitterkit-4hCeIip1cpTk9oPYeCbYKhVWi 71 | 72 | 73 | 74 | CFBundleVersion 75 | $(CURRENT_PROJECT_VERSION) 76 | LSApplicationQueriesSchemes 77 | 78 | wechat 79 | weixin 80 | mqqapi 81 | mqq 82 | mqqOpensdkSSoLogin 83 | mqqconnect 84 | mqqopensdkdataline 85 | mqqopensdkgrouptribeshare 86 | mqqopensdkfriend 87 | mqqopensdkapi 88 | mqqopensdkapiV2 89 | mqqopensdkapiV3 90 | mqqopensdkapiV4 91 | mqzoneopensdk 92 | wtloginmqq 93 | wtloginmqq2 94 | mqqwpa 95 | mqzone 96 | mqzonev2 97 | mqzoneshare 98 | wtloginqzone 99 | mqzonewx 100 | mqzoneopensdkapiV2 101 | mqzoneopensdkapi19 102 | mqzoneopensdkapi 103 | mqqbrowser 104 | mttbrowser 105 | sinaweibohd 106 | sinaweibo 107 | sinaweibosso 108 | weibosdk 109 | weibosdk2.5 110 | fbapi 111 | fb-messenger-api 112 | fbauth2 113 | fbshareextension 114 | twitter 115 | twitterauth 116 | JChatPro 117 | 118 | LSRequiresIPhoneOS 119 | 120 | UIBackgroundModes 121 | 122 | processing 123 | 124 | UILaunchStoryboardName 125 | LaunchScreen 126 | UIMainStoryboardFile 127 | Main 128 | UISupportedInterfaceOrientations 129 | 130 | UIInterfaceOrientationPortrait 131 | UIInterfaceOrientationLandscapeLeft 132 | UIInterfaceOrientationLandscapeRight 133 | 134 | UISupportedInterfaceOrientations~ipad 135 | 136 | UIInterfaceOrientationPortrait 137 | UIInterfaceOrientationPortraitUpsideDown 138 | UIInterfaceOrientationLandscapeLeft 139 | UIInterfaceOrientationLandscapeRight 140 | 141 | UIViewControllerBasedStatusBarAppearance 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'dart:async'; 3 | import 'dart:typed_data'; 4 | import 'dart:io'; 5 | 6 | import 'package:flutter/services.dart'; 7 | import 'package:jshare_flutter_plugin/jshare_flutter_plugin.dart'; 8 | import 'package:flutter/services.dart' show rootBundle; 9 | import 'package:path_provider/path_provider.dart'; 10 | 11 | void main() => runApp(MyApp()); 12 | 13 | class MyApp extends StatefulWidget { 14 | @override 15 | _MyAppState createState() => _MyAppState(); 16 | } 17 | 18 | class _MyAppState extends State { 19 | 20 | List> platfromList = [ 21 | { 22 | "name": "微信", 23 | "icon": "jiguang_socialize_wechat.png", 24 | "platform": JSharePlatform.wechatSession 25 | }, 26 | { 27 | "name": "朋友圈", 28 | "icon": "jiguang_socialize_wxtimeLine.png", 29 | "platform": JSharePlatform.wechatTimeLine 30 | }, 31 | { 32 | "name": "微信收藏", 33 | "icon": "jiguang_socialize_wxfavorite.png", 34 | "platform": JSharePlatform.wechatFavourite 35 | }, 36 | { 37 | "name": "QQ", 38 | "icon": "jiguang_socialize_qq.png", 39 | "platform": JSharePlatform.qq 40 | }, 41 | { 42 | "name": "QQ空间", 43 | "icon": "jiguang_socialize_qzone.png", 44 | "platform": JSharePlatform.qZone 45 | }, 46 | { 47 | "name": "微博", 48 | "icon": "jiguang_socialize_sina.png", 49 | "platform": JSharePlatform.sinaWeibo 50 | }, 51 | { 52 | "name": "FaceBook", 53 | "icon": "jiguang_socialize_facebook.png", 54 | "platform": JSharePlatform.facebook 55 | }, 56 | { 57 | "name": "Twitter", 58 | "icon": "jiguang_socialize_twitter.png", 59 | "platform": JSharePlatform.twitter 60 | } 61 | ]; 62 | 63 | String _resultString = "显示结果"; 64 | 65 | JShare jShare = new JShare(); 66 | JShareType? shareType; 67 | 68 | @override 69 | void initState() { 70 | super.initState(); 71 | initPlatformState(); 72 | } 73 | 74 | Future initPlatformState() async { 75 | 76 | JShareConfig shareConfig = new JShareConfig(appKey: "");/// 填写自己应用的极光 AppKey 77 | 78 | shareConfig.channel = "channel"; 79 | shareConfig.isDebug = true; 80 | shareConfig.isAdvertisinId = true; 81 | shareConfig.isProduction = true; 82 | 83 | shareConfig.weChatAppId = "wxc40e16f3ba6ebabc"; 84 | shareConfig.weChatAppSecret = "dcad950cd0633a27e353477c4ec12e7a"; 85 | 86 | shareConfig.qqAppId = "100424468"; 87 | shareConfig.qqAppKey = "glFYjkHQGSOCJHMC"; 88 | 89 | shareConfig.sinaWeiboAppKey = "374535501"; 90 | shareConfig.sinaWeiboAppSecret = "baccd12c166f1df96736b51ffbf600a2"; 91 | shareConfig.sinaRedirectUri = "https://www.jiguang.cn"; 92 | 93 | shareConfig.facebookAppID = "1847959632183996"; 94 | shareConfig.facebookDisplayName = "JShareDemo"; 95 | 96 | shareConfig.twitterConsumerKey = "4hCeIip1cpTk9oPYeCbYKhVWi"; 97 | shareConfig.twitterConsumerSecret = 98 | "DuIontT8KPSmO2Y1oAvby7tpbWHJimuakpbiAUHEKncbffekmC"; 99 | 100 | jShare.setup(config: shareConfig); 101 | 102 | if (!mounted) return; 103 | } 104 | 105 | @override 106 | Widget build(BuildContext context) { 107 | return MaterialApp( 108 | home: new Scaffold( 109 | appBar: new AppBar(title: new Text("")), 110 | body: new Center( 111 | child: new Builder(builder: (BuildContext context) { 112 | return new Column( 113 | children: [ 114 | new Container( 115 | margin: EdgeInsets.fromLTRB(10, 10, 10, 10), 116 | color: Colors.brown, 117 | child: Text(_resultString), 118 | width: 300, 119 | height: 100, 120 | ), 121 | new Container( 122 | margin: EdgeInsets.all(10), 123 | //color: Colors.brown, 124 | child: new Row( 125 | children: [ 126 | Expanded( 127 | flex: 1, 128 | child: new CustomButton( 129 | title: "分享【文本】", 130 | onPressed: () { 131 | _showSheet(context, JShareType.text); 132 | }, 133 | ), 134 | ), 135 | new Text(" "), 136 | Expanded( 137 | flex: 1, 138 | child: new CustomButton( 139 | title: "分享【图片】", 140 | onPressed: () { 141 | _showSheet(context, JShareType.image); 142 | }, 143 | ), 144 | ), 145 | new Text(" "), 146 | Expanded( 147 | flex: 1, 148 | child: new CustomButton( 149 | title: "分享【链接】", 150 | onPressed: () { 151 | _showSheet(context, JShareType.link); 152 | }, 153 | ), 154 | ), 155 | ], 156 | ), 157 | ), 158 | new Container( 159 | margin: EdgeInsets.fromLTRB(10, 0, 10, 10), 160 | child: new Row( 161 | children: [ 162 | Expanded( 163 | flex: 1, 164 | child: new CustomButton( 165 | title: "分享【音乐】", 166 | onPressed: () { 167 | _showSheet(context, JShareType.audio); 168 | }, 169 | ), 170 | ), 171 | new Text(" "), 172 | Expanded( 173 | flex: 1, 174 | child: new CustomButton( 175 | title: "分享【视频】", 176 | onPressed: () { 177 | _showSheet(context, JShareType.video); 178 | }, 179 | ), 180 | ), 181 | new Text(" "), 182 | Expanded( 183 | flex: 1, 184 | child: new CustomButton( 185 | title: "分享【APP】", 186 | onPressed: () { 187 | _showSheet(context, JShareType.app); 188 | }, 189 | ), 190 | ), 191 | ], 192 | )), 193 | new CustomButton( 194 | title: "分享【小程序】", 195 | onPressed: () { 196 | _showSheet(context, JShareType.miniProgram); 197 | }, 198 | ), 199 | new Divider(height: 10,color: Colors.brown), 200 | new Text("以下示例以【微信】为例"), 201 | new Container( 202 | margin: EdgeInsets.fromLTRB(10, 10, 10, 10), 203 | child: new Row( 204 | children: [ 205 | Expanded( 206 | flex: 1, 207 | child: new CustomButton( 208 | title: "是否授权", 209 | onPressed: () { 210 | jShare.isPlatformAuth(platform: JSharePlatform.wechatSession).then((JShareResponse response){ 211 | setState(() { 212 | _resultString = "是否授权:" + response.toJsonMap().toString(); 213 | }); 214 | }).catchError((error){ 215 | setState(() { 216 | _resultString = "是否授权:" + error.toString(); 217 | }); 218 | }); 219 | }, 220 | ), 221 | ), 222 | new Text(" "), 223 | Expanded( 224 | flex: 1, 225 | child: new CustomButton( 226 | title: "授权", 227 | onPressed: () { 228 | jShare.authorize(platform: JSharePlatform.wechatSession).then((JShareSocial value){ 229 | setState(() { 230 | _resultString = "授权:" + value.toJsonMap().toString(); 231 | }); 232 | }).catchError((error){ 233 | setState(() { 234 | _resultString = "授权:" + error.toString(); 235 | }); 236 | }); 237 | }, 238 | ), 239 | ), 240 | new Text(" "), 241 | Expanded( 242 | flex: 1, 243 | child: new CustomButton( 244 | title: "取消授权", 245 | onPressed: () { 246 | jShare.cancelPlatformAuth(platform: JSharePlatform.wechatSession).then((JShareResponse response){ 247 | setState(() { 248 | _resultString = "取消授权:" + response.toJsonMap().toString(); 249 | }); 250 | }).catchError((error){ 251 | setState(() { 252 | _resultString = "取消授权:" + error.toString(); 253 | }); 254 | }); 255 | }, 256 | ), 257 | ), 258 | ], 259 | ) 260 | ), 261 | new CustomButton( 262 | title: "获取【用户信息】", 263 | onPressed: () { 264 | jShare.getUserInfo(platform: JSharePlatform.wechatSession).then((JShareUserInfo info){ 265 | setState(() { 266 | _resultString = "获取用户信息:" + info.toJsonMap().toString(); 267 | }); 268 | }).catchError((error){ 269 | setState(() { 270 | _resultString = "获取用户信息:" + error.toString(); 271 | }); 272 | }); 273 | }, 274 | ), 275 | ], 276 | ); 277 | }), 278 | ), 279 | )); 280 | } 281 | 282 | 283 | Widget? _showSheet(BuildContext context, JShareType type) { 284 | shareType = type; 285 | showModalBottomSheet( 286 | context: context, 287 | builder: (BuildContext context) { 288 | return _shareWidget(context); 289 | }); 290 | } 291 | 292 | Widget _shareWidget(BuildContext context) { 293 | return new Container( 294 | height: 300, 295 | color: Colors.white, 296 | child: new Column( 297 | children: [ 298 | new Padding( 299 | padding: EdgeInsets.fromLTRB(0, 10, 0, 10), 300 | child: new Container( 301 | height: 200, 302 | child: new GridView.builder( 303 | gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount( 304 | crossAxisCount: 4, 305 | mainAxisSpacing: 5.0, 306 | childAspectRatio: 1.0), 307 | itemBuilder: (BuildContext context, int index) { 308 | return new Column( 309 | children: [ 310 | new Padding( 311 | padding: EdgeInsets.fromLTRB(0, 6, 0, 6), 312 | child: new GestureDetector( 313 | child: new Image.asset( 314 | 'assets/images/${platfromList[index]["icon"]}', 315 | width: 50, 316 | height: 50, 317 | fit: BoxFit.fill, 318 | ), 319 | onTap: () { 320 | Navigator.of(context).pop(); 321 | _didSelectPlatform(index: index); 322 | }, 323 | )), 324 | new Text(platfromList[index]["name"]), 325 | ], 326 | ); 327 | }, 328 | itemCount: platfromList.length, 329 | ), 330 | ), 331 | ), 332 | new Divider(height: 0.5, color: Colors.blueGrey), 333 | new Center( 334 | child: new Padding( 335 | padding: EdgeInsets.fromLTRB(0, 8, 0, 8), 336 | child: new GestureDetector( 337 | onTap: () { 338 | Navigator.of(context).pop(); 339 | }, 340 | child: new Text( 341 | "取 消", 342 | style: 343 | new TextStyle(fontSize: 20.0, color: Colors.blueGrey), 344 | ))), 345 | ), 346 | ], 347 | ), 348 | ); 349 | } 350 | 351 | /// 选择摸个平台分享 352 | void _didSelectPlatform({required int index}) async { 353 | print("Action - didSelectPlatform: " + 354 | "platfrom = " + 355 | platfromList[index].toString()); 356 | 357 | JShareMessage message = new JShareMessage(); 358 | message.mediaType = shareType; 359 | message.platform = platfromList[index]["platform"]; 360 | 361 | if (message.platform != JSharePlatform.sinaWeibo) { 362 | // 新浪可以支持网页分享 363 | bool isValid = await jShare.isClientValid(platform: message.platform!); 364 | if (isValid == false) { 365 | print("is not available platfrom (" + 366 | platfromList[index].toString() + 367 | ")"); 368 | return; 369 | } 370 | } 371 | 372 | message.text = "jshare-text"; 373 | message.title = "jshare-title"; 374 | message.url = "https://www.jiguang.cn/"; 375 | 376 | /// 添加 测试图片 377 | String tempImagePath = await _tempSaveTestImage(); 378 | 379 | if (shareType == JShareType.image) { 380 | //大图 381 | message.imagePath = tempImagePath; 382 | } else { 383 | //缩略图 384 | message.imagePath = tempImagePath; 385 | } 386 | 387 | if (shareType == JShareType.audio) { 388 | //音频跳转链接 389 | message.url = "https://y.qq.com/n/yqq/song/003RCA7t0y6du5.html"; 390 | // 音频源链接,直接播放 391 | // message.musicDataUrl = ""; 392 | } else if (shareType == JShareType.video) { 393 | //视频源 394 | if (message.platform == JSharePlatform.qZone || 395 | message.platform == JSharePlatform.facebook || 396 | message.platform == JSharePlatform.facebookMessenger || 397 | message.platform == JSharePlatform.twitter) { 398 | //message.videoPath = "";Android 为本地路径,iOS 为ALAsset的ALAssetPropertyAssetURL 399 | } else { 400 | message.url = "http://v.youku.com/v_show/id_XOTQwMDE1ODAw.html?from=s1.8-1-1.2&spm=a2h0k.8191407.0.0"; 401 | } 402 | } else if (shareType == JShareType.link) { 403 | //分享网页链接 404 | // 405 | } else if (shareType == JShareType.app) { 406 | //message.fileDataPath = ""; iOS 端 APP 数据 407 | message.extInfo = "extend info"; 408 | } else if (shareType == JShareType.file) { 409 | // message.fileDataPath = ""; 410 | //message.fileExt = ""; 411 | } else if (shareType == JShareType.emoticon) { 412 | // message.emoticonDataPath = 413 | } else if (shareType == JShareType.miniProgram) { 414 | message.miniProgramUserName = "gh_cd370c00d3d4"; 415 | message.miniProgramPath = "pages/index/index"; 416 | message.miniProgramType = 0; 417 | message.miniProgramWithShareTicket = true; 418 | // 小程序封面图 419 | //message.imageUrl = "https://img2.3lian.com/2014/f5/63/d/23.jpg"; 420 | } else {} 421 | 422 | jShare.shareMessage(message: message).then((JShareResponse response) { 423 | print("分享回调:" + response.toJsonMap().toString()); 424 | setState(() { 425 | _resultString = "分享成功:"+ response.toJsonMap().toString(); 426 | }); 427 | /// 删除测试图片 428 | _tempDeleteTestImage(); 429 | }).catchError((error) { 430 | print("分享回调 -- 出错:${error.toString()}"); 431 | 432 | setState(() { 433 | _resultString = "分享失败:"+ error.toString(); 434 | }); 435 | 436 | /// 删除测试图片 437 | _tempDeleteTestImage(); 438 | }); 439 | } 440 | 441 | 442 | /// TEST : 测试图片 443 | static String testImageName = "icon_jiguang.png"; 444 | 445 | Future _tempSaveTestImage() async { 446 | print("Action - _tempSaveTestImage:"); 447 | final Directory directory = await getTemporaryDirectory(); 448 | 449 | Uint8List bytes = await _getAssetsImageBytes(testImageName); 450 | String path = await _saveFile(directory, testImageName, bytes); 451 | 452 | return path; 453 | } 454 | 455 | /// TEST : 删除图片 456 | void _tempDeleteTestImage() async { 457 | print("Action - _tempDeleteTestImage:"); 458 | final Directory directory = await getTemporaryDirectory(); 459 | String imageName = testImageName; 460 | _deleteFile(directory, imageName); 461 | } 462 | 463 | 464 | /// TEST : 获取 assets里的图片(测试暂时用 assets 里的) 465 | Future _getAssetsImageBytes(String imagePath) async { 466 | print("Action - getAssetsImageBytes:" + imagePath); 467 | 468 | ByteData byteData = await rootBundle.load("assets/images/"+imagePath); 469 | Uint8List uint8list = byteData.buffer.asUint8List(); 470 | 471 | return uint8list; 472 | } 473 | 474 | /// TEST : 存储文件 475 | Future _saveFile(Directory directory, String name, Uint8List bytes) async { 476 | print("Action - _saveFile:" + "directory:" + directory.toString() + ",name:" + name); 477 | final File file = File('${directory.path}/$name'); 478 | 479 | if (file.existsSync()) { 480 | file.deleteSync(); 481 | } 482 | 483 | File file1 = await file.writeAsBytes(bytes); 484 | 485 | if(file1.existsSync()) { 486 | print('====保存成功'); 487 | }else{ 488 | print('====保存失败'); 489 | } 490 | return file1.path; 491 | } 492 | 493 | /// TEST : 获取文件路径 494 | String? _getFilePath(Directory directory, String name){ 495 | print("Action - _getFilePath:"); 496 | final File file = File('${directory.path}/$name'); 497 | if (!file.existsSync()) { 498 | return null; 499 | } 500 | String path = file.readAsStringSync(); 501 | return path; 502 | } 503 | 504 | /// TEST : 删除文件 505 | void _deleteFile(Directory directory, String name) { 506 | print("Action - _deleteFile:"); 507 | final File file = File('${directory.path}/$name'); 508 | 509 | if (file.existsSync()) { 510 | file.deleteSync(); 511 | } 512 | } 513 | } 514 | 515 | 516 | 517 | /// 封装 按钮 518 | class CustomButton extends StatelessWidget { 519 | final VoidCallback? onPressed; 520 | final String? title; 521 | 522 | const CustomButton({@required this.onPressed, this.title}); 523 | 524 | @override 525 | Widget build(BuildContext context) { 526 | // TODO: implement build 527 | return new FlatButton( 528 | onPressed: onPressed, 529 | child: new Text("$title"), 530 | color: Color(0xff585858), 531 | highlightColor: Color(0xff888888), 532 | splashColor: Color(0xff888888), 533 | textColor: Colors.white, 534 | padding: EdgeInsets.fromLTRB(10, 5, 10, 5), 535 | ); 536 | } 537 | } 538 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "2.6.1" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "2.1.0" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "1.1.0" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.2.0" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.1.0" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.15.0" 46 | cupertino_icons: 47 | dependency: "direct main" 48 | description: 49 | name: cupertino_icons 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "1.0.3" 53 | fake_async: 54 | dependency: transitive 55 | description: 56 | name: fake_async 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "1.2.0" 60 | ffi: 61 | dependency: transitive 62 | description: 63 | name: ffi 64 | url: "https://pub.flutter-io.cn" 65 | source: hosted 66 | version: "1.0.0" 67 | file: 68 | dependency: transitive 69 | description: 70 | name: file 71 | url: "https://pub.flutter-io.cn" 72 | source: hosted 73 | version: "6.1.0" 74 | flutter: 75 | dependency: "direct main" 76 | description: flutter 77 | source: sdk 78 | version: "0.0.0" 79 | flutter_test: 80 | dependency: "direct dev" 81 | description: flutter 82 | source: sdk 83 | version: "0.0.0" 84 | jshare_flutter_plugin: 85 | dependency: "direct dev" 86 | description: 87 | path: ".." 88 | relative: true 89 | source: path 90 | version: "2.1.0" 91 | matcher: 92 | dependency: transitive 93 | description: 94 | name: matcher 95 | url: "https://pub.flutter-io.cn" 96 | source: hosted 97 | version: "0.12.10" 98 | meta: 99 | dependency: transitive 100 | description: 101 | name: meta 102 | url: "https://pub.flutter-io.cn" 103 | source: hosted 104 | version: "1.3.0" 105 | path: 106 | dependency: transitive 107 | description: 108 | name: path 109 | url: "https://pub.flutter-io.cn" 110 | source: hosted 111 | version: "1.8.0" 112 | path_provider: 113 | dependency: "direct main" 114 | description: 115 | name: path_provider 116 | url: "https://pub.flutter-io.cn" 117 | source: hosted 118 | version: "2.0.1" 119 | path_provider_linux: 120 | dependency: transitive 121 | description: 122 | name: path_provider_linux 123 | url: "https://pub.flutter-io.cn" 124 | source: hosted 125 | version: "2.0.0" 126 | path_provider_macos: 127 | dependency: transitive 128 | description: 129 | name: path_provider_macos 130 | url: "https://pub.flutter-io.cn" 131 | source: hosted 132 | version: "2.0.0" 133 | path_provider_platform_interface: 134 | dependency: transitive 135 | description: 136 | name: path_provider_platform_interface 137 | url: "https://pub.flutter-io.cn" 138 | source: hosted 139 | version: "2.0.1" 140 | path_provider_windows: 141 | dependency: transitive 142 | description: 143 | name: path_provider_windows 144 | url: "https://pub.flutter-io.cn" 145 | source: hosted 146 | version: "2.0.0" 147 | platform: 148 | dependency: transitive 149 | description: 150 | name: platform 151 | url: "https://pub.flutter-io.cn" 152 | source: hosted 153 | version: "3.0.0" 154 | plugin_platform_interface: 155 | dependency: transitive 156 | description: 157 | name: plugin_platform_interface 158 | url: "https://pub.flutter-io.cn" 159 | source: hosted 160 | version: "2.0.0" 161 | process: 162 | dependency: transitive 163 | description: 164 | name: process 165 | url: "https://pub.flutter-io.cn" 166 | source: hosted 167 | version: "4.2.1" 168 | sky_engine: 169 | dependency: transitive 170 | description: flutter 171 | source: sdk 172 | version: "0.0.99" 173 | source_span: 174 | dependency: transitive 175 | description: 176 | name: source_span 177 | url: "https://pub.flutter-io.cn" 178 | source: hosted 179 | version: "1.8.1" 180 | stack_trace: 181 | dependency: transitive 182 | description: 183 | name: stack_trace 184 | url: "https://pub.flutter-io.cn" 185 | source: hosted 186 | version: "1.10.0" 187 | stream_channel: 188 | dependency: transitive 189 | description: 190 | name: stream_channel 191 | url: "https://pub.flutter-io.cn" 192 | source: hosted 193 | version: "2.1.0" 194 | string_scanner: 195 | dependency: transitive 196 | description: 197 | name: string_scanner 198 | url: "https://pub.flutter-io.cn" 199 | source: hosted 200 | version: "1.1.0" 201 | term_glyph: 202 | dependency: transitive 203 | description: 204 | name: term_glyph 205 | url: "https://pub.flutter-io.cn" 206 | source: hosted 207 | version: "1.2.0" 208 | test_api: 209 | dependency: transitive 210 | description: 211 | name: test_api 212 | url: "https://pub.flutter-io.cn" 213 | source: hosted 214 | version: "0.3.0" 215 | typed_data: 216 | dependency: transitive 217 | description: 218 | name: typed_data 219 | url: "https://pub.flutter-io.cn" 220 | source: hosted 221 | version: "1.3.0" 222 | vector_math: 223 | dependency: transitive 224 | description: 225 | name: vector_math 226 | url: "https://pub.flutter-io.cn" 227 | source: hosted 228 | version: "2.1.0" 229 | win32: 230 | dependency: transitive 231 | description: 232 | name: win32 233 | url: "https://pub.flutter-io.cn" 234 | source: hosted 235 | version: "2.0.4" 236 | xdg_directories: 237 | dependency: transitive 238 | description: 239 | name: xdg_directories 240 | url: "https://pub.flutter-io.cn" 241 | source: hosted 242 | version: "0.2.0" 243 | sdks: 244 | dart: ">=2.12.0 <3.0.0" 245 | flutter: ">=1.20.0" 246 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: jshare_flutter_plugin_example 2 | description: Demonstrates how to use the jshare_flutter_plugin plugin. 3 | publish_to: 'none' 4 | 5 | environment: 6 | sdk: ">=2.12.0 <3.0.0" 7 | 8 | dependencies: 9 | flutter: 10 | sdk: flutter 11 | path_provider: ^2.0.1 12 | 13 | # The following adds the Cupertino Icons font to your application. 14 | # Use with the CupertinoIcons class for iOS style icons. 15 | cupertino_icons: ^1.0.3 16 | 17 | dev_dependencies: 18 | flutter_test: 19 | sdk: flutter 20 | 21 | jshare_flutter_plugin: 22 | path: ../ 23 | 24 | # For information on the generic Dart part of this file, see the 25 | # following page: https://dart.dev/tools/pub/pubspec 26 | 27 | # The following section is specific to Flutter. 28 | flutter: 29 | 30 | uses-material-design: true 31 | 32 | assets: 33 | - assets/images/icon_jiguang.png 34 | - assets/images/jiguang_socialize_wechat.png 35 | - assets/images/jiguang_socialize_wxtimeLine.png 36 | - assets/images/jiguang_socialize_wxfavorite.png 37 | - assets/images/jiguang_socialize_qq.png 38 | - assets/images/jiguang_socialize_qzone.png 39 | - assets/images/jiguang_socialize_sina.png 40 | - assets/images/jiguang_socialize_facebook.png 41 | - assets/images/jiguang_socialize_twitter.png 42 | 43 | # The following line ensures that the Material Icons font is 44 | # included with your application, so that you can use the icons in 45 | # the material Icons class. 46 | 47 | 48 | # To add assets to your application, add an assets section, like this: 49 | 50 | # An image asset can refer to one or more resolution-specific "variants", see 51 | # https://flutter.dev/assets-and-images/#resolution-aware. 52 | 53 | # For details regarding adding assets from package dependencies, see 54 | # https://flutter.dev/assets-and-images/#from-packages 55 | 56 | # To add custom fonts to your application, add a fonts section here, 57 | # in this "flutter" section. Each entry in this list should have a 58 | # "family" key with the font family name, and a "fonts" key with a 59 | # list giving the asset and other descriptors for the font. For 60 | # example: 61 | # fonts: 62 | # - family: Schyler 63 | # fonts: 64 | # - asset: fonts/Schyler-Regular.ttf 65 | # - asset: fonts/Schyler-Italic.ttf 66 | # style: italic 67 | # - family: Trajan Pro 68 | # fonts: 69 | # - asset: fonts/TrajanPro.ttf 70 | # - asset: fonts/TrajanPro_Bold.ttf 71 | # weight: 700 72 | # 73 | # For details regarding fonts from package dependencies, 74 | # see https://flutter.dev/custom-fonts/#from-packages 75 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:jshare_flutter_plugin_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => widget is Text && 22 | widget.data!.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/JshareFlutterPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface JshareFlutterPlugin : NSObject 4 | @property FlutterMethodChannel *channel; 5 | @end 6 | -------------------------------------------------------------------------------- /ios/Classes/JshareFlutterPlugin.m: -------------------------------------------------------------------------------- 1 | #import "JshareFlutterPlugin.h" 2 | #import "JSHAREService.h" 3 | #import 4 | 5 | #define JSLog(fmt, ...) NSLog((@"| JSHARE | iOS | - " fmt), ##__VA_ARGS__) 6 | 7 | /// 错误码 8 | static NSString *const j_code_key = @"code"; 9 | /// 回调的提示信息,统一返回 flutter 为 message 10 | static NSString *const j_msg_key = @"message"; 11 | // 成功 12 | static NSString *j_success_code = @"success"; 13 | // 取消 14 | static NSString *j_cancel_code = @"cancel"; 15 | // 失败 16 | static NSString *j_fail_code = @"fail"; 17 | 18 | @implementation JshareFlutterPlugin 19 | + (void)registerWithRegistrar:(NSObject*)registrar { 20 | FlutterMethodChannel* channel = [FlutterMethodChannel methodChannelWithName:@"jshare_flutter_plugin" binaryMessenger:[registrar messenger]]; 21 | 22 | JshareFlutterPlugin* instance = [[JshareFlutterPlugin alloc] init]; 23 | [registrar addMethodCallDelegate:instance channel:channel]; 24 | [registrar addApplicationDelegate:instance]; 25 | } 26 | 27 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { 28 | JSLog(@"Action - handleMethodCall: %@",call.method); 29 | 30 | NSString *methodName = call.method; 31 | if ([methodName isEqualToString:@"getPlatformVersion"]) { 32 | result([@"iOS " stringByAppendingString:[[UIDevice currentDevice] systemVersion]]); 33 | } else if ([methodName isEqualToString:@"setup"]) { 34 | [self setup:call]; 35 | } else if ([methodName isEqualToString:@"isClientValid"]) { 36 | [self isClientValid:call result:result]; 37 | } else if ([methodName isEqualToString:@"shareMessage"]) { 38 | [self shareMessage:call result:result]; 39 | } else if ([methodName isEqualToString:@"authorize"]) { 40 | [self authorize:call result:result]; 41 | } else if ([methodName isEqualToString:@"isPlatformAuth"]) { 42 | [self isPlatformAuth:call result:result]; 43 | } else if ([methodName isEqualToString:@"cancelPlatformAuth"]) { 44 | [self cancelPlatformAuth:call result:result]; 45 | } else if ([methodName isEqualToString:@"getUserInfo"]) { 46 | [self getUserInfo:call result:result]; 47 | } else { 48 | result(FlutterMethodNotImplemented); 49 | } 50 | } 51 | - (void)setup:(FlutterMethodCall *)call { 52 | JSHARELaunchConfig *config = [[JSHARELaunchConfig alloc] init]; 53 | NSString *appKey = call.arguments[@"appKey"]; 54 | if (appKey) { 55 | config.appKey = appKey; 56 | } 57 | NSString *weChatAppId = call.arguments[@"weChatAppId"]; 58 | if (weChatAppId) { 59 | config.WeChatAppId = weChatAppId; 60 | } 61 | NSString *weChatAppSecret = call.arguments[@"weChatAppSecret"]; 62 | if (weChatAppSecret) { 63 | config.WeChatAppSecret = weChatAppSecret; 64 | } 65 | NSString *universallink = call.arguments[@"universalLink"]; 66 | if (universallink) { 67 | config.universalLink = universallink; 68 | } 69 | 70 | NSString *qqAppId = call.arguments[@"qqAppId"]; 71 | if (qqAppId) { 72 | config.QQAppId = qqAppId; 73 | } 74 | 75 | NSString *qqAppKey = call.arguments[@"qqAppKey"]; 76 | if (qqAppKey) { 77 | config.QQAppKey = qqAppKey; 78 | } 79 | 80 | NSString *sinaWeiboAppKey = call.arguments[@"sinaWeiboAppKey"]; 81 | if (sinaWeiboAppKey) { 82 | config.SinaWeiboAppKey = sinaWeiboAppKey; 83 | } 84 | NSString *sinaWeiboAppSecret = call.arguments[@"sinaWeiboAppSecret"]; 85 | if (sinaWeiboAppSecret) { 86 | config.SinaWeiboAppSecret = sinaWeiboAppSecret; 87 | } 88 | NSString *sinaRedirectUri = call.arguments[@"sinaRedirectUri"]; 89 | if (sinaRedirectUri) { 90 | config.SinaRedirectUri = sinaRedirectUri; 91 | } 92 | NSString *facebookAppID = call.arguments[@"facebookAppID"]; 93 | if (facebookAppID) { 94 | config.FacebookAppID = facebookAppID; 95 | } 96 | 97 | NSString *facebookDisplayName = call.arguments[@"facebookDisplayName"]; 98 | if (facebookDisplayName) { 99 | config.FacebookDisplayName = facebookDisplayName; 100 | } 101 | 102 | NSString *twitterConsumerKey = call.arguments[@"twitterConsumerKey"]; 103 | if (twitterConsumerKey) { 104 | config.TwitterConsumerKey = twitterConsumerKey; 105 | } 106 | NSString *twitterConsumerSecret = call.arguments[@"twitterConsumerSecret"]; 107 | if (twitterConsumerSecret) { 108 | config.TwitterConsumerSecret = twitterConsumerSecret; 109 | } 110 | 111 | config.isSupportWebSina = YES; 112 | 113 | NSString *channel = call.arguments[@"channel"]; 114 | if (channel) { 115 | config.channel = channel; 116 | } 117 | NSNumber *isProduction = call.arguments[@"isProduction"]; 118 | if (isProduction) { 119 | config.isProduction = [isProduction boolValue]; 120 | } 121 | NSNumber *isAdvertisinId = call.arguments[@"isAdvertisinId"]; 122 | if ([isAdvertisinId boolValue]) { 123 | NSString *advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; 124 | config.advertisingId = advertisingId; 125 | } 126 | 127 | [JSHAREService setupWithConfig:config]; 128 | 129 | NSNumber *isDebug = call.arguments[@"isDebug"]; 130 | [JSHAREService setDebug:[isDebug boolValue]]; 131 | } 132 | 133 | - (void)isClientValid:(FlutterMethodCall *)call result:(FlutterResult)result { 134 | NSString *platformName = call.arguments[@"platform"]; 135 | JSHAREPlatform platform = [self getSharePlatform:platformName]; 136 | BOOL isValid = NO; 137 | switch (platform) { 138 | case JSHAREPlatformWechatSession: 139 | case JSHAREPlatformWechatTimeLine: 140 | case JSHAREPlatformWechatFavourite: 141 | isValid = [JSHAREService isWeChatInstalled]; 142 | break; 143 | case JSHAREPlatformQQ: 144 | case JSHAREPlatformQzone: 145 | isValid = [JSHAREService isQQInstalled]; 146 | break; 147 | case JSHAREPlatformSinaWeibo: 148 | case JSHAREPlatformSinaWeiboContact: 149 | isValid = [JSHAREService isSinaWeiBoInstalled]; 150 | break; 151 | case JSHAREPlatformFacebook: 152 | isValid = [JSHAREService isFacebookInstalled]; 153 | break; 154 | case JSHAREPlatformFacebookMessenger: 155 | isValid = [JSHAREService isFacebookMessengerInstalled]; 156 | break; 157 | case JSHAREPlatformTwitter: 158 | isValid = [JSHAREService isTwitterInstalled]; 159 | break; 160 | 161 | default: 162 | break; 163 | } 164 | 165 | NSDictionary *dict = @{j_code_key:isValid?j_success_code:j_fail_code, 166 | j_msg_key:@""}; 167 | dispatch_async(dispatch_get_main_queue(), ^{ 168 | result(dict); 169 | }); 170 | } 171 | - (void)shareMessage:(FlutterMethodCall *)call result:(FlutterResult)result { 172 | 173 | // 分享内容 174 | JSHAREMessage *message = [self message:call.arguments]; 175 | if (!message) { 176 | return ; 177 | } 178 | 179 | [JSHAREService share:message handler:^(JSHAREState state, NSError *error) { 180 | 181 | NSString *stateStr = nil; 182 | NSString *desc = @""; 183 | if (state == JSHAREStateSuccess) { 184 | stateStr = j_success_code; 185 | desc = @"分享成功"; 186 | }else if (state == JSHAREStateFail){ 187 | stateStr = j_fail_code; 188 | desc = error.description; 189 | }else if (state == JSHAREStateCancel){ 190 | stateStr = j_cancel_code; 191 | desc = @"取消分享"; 192 | }else{ 193 | stateStr = j_fail_code; 194 | desc = @"未知错误"; 195 | } 196 | NSDictionary *dict = @{j_code_key:stateStr, 197 | j_msg_key:desc}; 198 | dispatch_async(dispatch_get_main_queue(), ^{ 199 | result(dict); 200 | }); 201 | }]; 202 | } 203 | 204 | - (void)authorize:(FlutterMethodCall *)call result:(FlutterResult)result { 205 | NSString *platformName = call.arguments[@"platform"]; 206 | JSHAREPlatform platform = [self getSharePlatform:platformName]; 207 | [self getInfoWithPlatform:platform isAuthorize:YES result:result]; 208 | } 209 | 210 | - (void)isPlatformAuth:(FlutterMethodCall *)call result:(FlutterResult)result{ 211 | NSString *platformName = call.arguments[@"platform"]; 212 | JSHAREPlatform platform = [self getSharePlatform:platformName]; 213 | BOOL isAuth = [JSHAREService isPlatformAuth:platform]; 214 | 215 | NSDictionary *dict = @{j_code_key:isAuth?j_success_code:j_fail_code, 216 | j_msg_key:isAuth?@"已授权":@"未授权"}; 217 | dispatch_async(dispatch_get_main_queue(), ^{ 218 | result(dict); 219 | }); 220 | } 221 | 222 | - (void)cancelPlatformAuth:(FlutterMethodCall *)call result:(FlutterResult)result { 223 | NSString *platformName = call.arguments[@"platform"]; 224 | JSHAREPlatform platform = [self getSharePlatform:platformName]; 225 | BOOL isCancel = [JSHAREService cancelAuthWithPlatform:platform]; 226 | 227 | NSDictionary *dict = @{j_code_key:isCancel?j_success_code:j_fail_code, 228 | j_msg_key:isCancel?@"取消授权成功":@"取消授权失败"}; 229 | dispatch_async(dispatch_get_main_queue(), ^{ 230 | result(dict); 231 | }); 232 | } 233 | 234 | - (void)getUserInfo:(FlutterMethodCall *)call result:(FlutterResult)result { 235 | NSString *platformName = call.arguments[@"platform"]; 236 | JSHAREPlatform platform = [self getSharePlatform:platformName]; 237 | [self getInfoWithPlatform:platform isAuthorize:NO result:result]; 238 | } 239 | /// 授权和获取用户信息 240 | - (void)getInfoWithPlatform:(JSHAREPlatform)platform isAuthorize:(BOOL)isAuthorize result:(FlutterResult)result { 241 | [JSHAREService getSocialUserInfo:platform handler:^(JSHARESocialUserInfo *userInfo, NSError *error) { 242 | NSMutableDictionary *dict = [NSMutableDictionary dictionary]; 243 | if (error) { 244 | dict[j_code_key] = j_fail_code; 245 | dict[j_msg_key] = isAuthorize?@"授权失败":@"无法获取到用户信息"; 246 | }else{ 247 | dict = [self analysisSocialUserInfo:userInfo]; 248 | dict[j_code_key] = j_success_code; 249 | dict[j_msg_key] = isAuthorize?@"授权成功":@"获取用户信息成功"; 250 | 251 | dispatch_async(dispatch_get_main_queue(), ^{ 252 | result(dict); 253 | }); 254 | } 255 | dispatch_async(dispatch_get_main_queue(), ^{ 256 | result(dict); 257 | }); 258 | }]; 259 | } 260 | - (NSMutableDictionary *)analysisSocialUserInfo:(JSHARESocialUserInfo *)userInfo { 261 | NSMutableDictionary *dict = [NSMutableDictionary dictionary]; 262 | if (userInfo.name) { 263 | dict[@"name"] = userInfo.name; 264 | } 265 | if (userInfo.iconurl) { 266 | dict[@"imageUrl"] = userInfo.iconurl; 267 | } 268 | if (userInfo.gender) { 269 | dict[@"gender"] = [NSNumber numberWithInteger:userInfo.gender]; 270 | } 271 | if (userInfo.openid) { 272 | dict[@"openid"] = userInfo.openid; 273 | } 274 | if (userInfo.accessToken) { 275 | dict[@"token"] = userInfo.accessToken; 276 | } 277 | if (userInfo.refreshToken) { 278 | dict[@"refreshToken"] = userInfo.refreshToken; 279 | } 280 | if (userInfo.expiration) { 281 | dict[@"expiration"] = [NSString stringWithFormat:@"%@",@(userInfo.expiration)]; 282 | } 283 | if (userInfo.userOriginalResponse) { 284 | dict[@"originData"] = [self toJsonString:userInfo.userOriginalResponse]; 285 | } 286 | if (userInfo.oauthOriginalResponse) { 287 | dict[@"originData"] = [self toJsonString:userInfo.oauthOriginalResponse]; 288 | } 289 | return dict; 290 | } 291 | - (NSString *)toJsonString:(NSDictionary *)dic{ 292 | NSError *error; 293 | NSData *data = [NSJSONSerialization dataWithJSONObject:dic options:0 error:&error]; 294 | NSString *jsonString = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding]; 295 | return jsonString; 296 | } 297 | - (JSHAREMessage *)message:(NSDictionary *)arguments { 298 | NSString *platformName = arguments[@"platform"]; 299 | NSString *shareTypeName = arguments[@"mediaType"]; 300 | 301 | if (!platformName) { 302 | return nil; 303 | } 304 | JSHAREPlatform platform = [self getSharePlatform:platformName]; 305 | if (!shareTypeName) { 306 | return nil; 307 | } 308 | JSHAREMediaType mediaType = [self getShareType:shareTypeName]; 309 | JSHAREMessage *message = [[JSHAREMessage alloc] init]; 310 | message.platform = platform; 311 | message.mediaType = mediaType; 312 | 313 | NSString *title = arguments[@"title"]; 314 | if (title) { 315 | message.title = title; 316 | } 317 | NSString *text = arguments[@"text"]; 318 | if (text) { 319 | message.text = text; 320 | } 321 | NSString *url = arguments[@"url"]; 322 | if (url) { 323 | message.url = url; 324 | } 325 | NSString *imagePath = arguments[@"imagePath"]; 326 | NSString *videoPath = arguments[@"videoPath"]; 327 | NSString *musicDataUrl = arguments[@"musicDataUrl"]; 328 | NSString *extInfo = arguments[@"extInfo"]; 329 | NSString *fileDataPath = arguments[@"fileDataPath"]; 330 | NSString *fileExt = arguments[@"fileExt"]; 331 | NSString *sinaObjectID = arguments[@"sinaObjectID"]; 332 | NSString *emoticonDataPath = arguments[@"emoticonDataPath"]; 333 | NSString *miniProgramUserName = arguments[@"miniProgramUserName"]; 334 | NSString *miniProgramPath = arguments[@"miniProgramPath"]; 335 | NSNumber *miniProgramType = arguments[@"miniProgramType"]; 336 | 337 | NSData *imageData = nil; 338 | if (imagePath) { 339 | imageData = [NSData dataWithContentsOfFile:imagePath]; 340 | if (platform == JSHAREPlatformFacebook || platform == JSHAREPlatformFacebookMessenger) { 341 | message.images = @[imageData]; 342 | }else{ 343 | message.image = imageData; 344 | } 345 | } 346 | if (musicDataUrl) { 347 | message.mediaDataUrl = musicDataUrl; 348 | } 349 | 350 | //wechat、qq、 qz(url 和本地视频) fb、fbm(本地)、tw(data) 351 | if (videoPath) { 352 | if (platform == JSHAREPlatformTwitter) { 353 | message.videoData = [NSData dataWithContentsOfFile:videoPath]; 354 | } else { 355 | //qz、fb、fbm 要传 ALAsset的ALAssetPropertyAssetURL 356 | // videoPath 转换成 ALAsset 357 | message.videoAssetURL = videoPath; 358 | } 359 | } 360 | 361 | switch (mediaType) { 362 | case JSHARELink: 363 | case JSHAREAudio: 364 | case JSHAREVideo: { 365 | //缩略图 366 | if (imageData) { 367 | message.thumbnail = imageData; 368 | } 369 | } 370 | break; 371 | case JSHAREApp: 372 | break; 373 | case JSHAREFile: 374 | break; 375 | case JSHAREEmoticon: 376 | break; 377 | case JSHAREMiniProgram: 378 | break; 379 | 380 | default: 381 | break; 382 | } 383 | 384 | if (extInfo) { 385 | message.extInfo = extInfo; 386 | } 387 | if (fileDataPath) { 388 | message.fileData = [NSData dataWithContentsOfFile:fileDataPath]; 389 | } 390 | if (fileExt) { 391 | message.fileExt = fileExt; 392 | } 393 | if (emoticonDataPath) { 394 | message.emoticonData = [NSData dataWithContentsOfFile:emoticonDataPath]; 395 | } 396 | if (sinaObjectID) { 397 | message.sinaObjectID = sinaObjectID; 398 | } 399 | 400 | if (miniProgramUserName) { 401 | message.userName = miniProgramUserName; 402 | } 403 | if (miniProgramPath) { 404 | message.path = miniProgramPath; 405 | } 406 | if (miniProgramType) { 407 | message.miniProgramType = [miniProgramType intValue]; 408 | } 409 | if (arguments[@"miniProgramWithShareTicket"]) { 410 | message.withShareTicket = [arguments[@"miniProgramWithShareTicket"] boolValue]; 411 | } 412 | 413 | return message; 414 | } 415 | - (JSHAREPlatform)getSharePlatform:(NSString *)platformName { 416 | JSHAREPlatform platform = JSHAREPlatformWechatSession; 417 | 418 | if ([platformName isEqualToString:@"wechatSession"]) { 419 | platform = JSHAREPlatformWechatSession; 420 | }else if ([platformName isEqualToString:@"wechatTimeLine"]) { 421 | platform = JSHAREPlatformWechatTimeLine; 422 | }else if ([platformName isEqualToString:@"wechatFavourite"]) { 423 | platform = JSHAREPlatformWechatFavourite; 424 | }else if ([platformName isEqualToString:@"qq"]) { 425 | platform = JSHAREPlatformQQ; 426 | }else if ([platformName isEqualToString:@"qZone"]) { 427 | platform = JSHAREPlatformQzone; 428 | }else if ([platformName isEqualToString:@"sinaWeibo"]) { 429 | platform = JSHAREPlatformSinaWeibo; 430 | }else if ([platformName isEqualToString:@"sinaWeiboContact"]) { 431 | platform = JSHAREPlatformSinaWeiboContact; 432 | }else if ([platformName isEqualToString:@"facebook"]) { 433 | platform = JSHAREPlatformFacebook; 434 | }else if ([platformName isEqualToString:@"facebookMessenger"]) { 435 | platform = JSHAREPlatformFacebookMessenger; 436 | }else if ([platformName isEqualToString:@"twitter"]) { 437 | platform = JSHAREPlatformTwitter; 438 | }else { 439 | platform = JSHAREPlatformWechatSession; 440 | } 441 | return platform; 442 | } 443 | - (JSHAREMediaType)getShareType:(NSString *)typeName { 444 | JSHAREMediaType type = JSHAREUndefined; 445 | if ([typeName isEqualToString:@"text"]) { 446 | type = JSHAREText; 447 | }else if ([typeName isEqualToString:@"image"]) { 448 | type = JSHAREImage; 449 | }else if ([typeName isEqualToString:@"link"]) { 450 | type = JSHARELink; 451 | }else if ([typeName isEqualToString:@"audio"]) { 452 | type = JSHAREAudio; 453 | }else if ([typeName isEqualToString:@"video"]) { 454 | type = JSHAREVideo; 455 | }else if ([typeName isEqualToString:@"app"]) { 456 | type = JSHAREApp; 457 | }else if ([typeName isEqualToString:@"file"]) { 458 | type = JSHAREFile; 459 | }else if ([typeName isEqualToString:@"emoticon"]) { 460 | type = JSHAREEmoticon; 461 | }else if ([typeName isEqualToString:@"miniProgram"]) { 462 | type = JSHAREMiniProgram; 463 | }else{ 464 | type = JSHAREUndefined; 465 | } 466 | return type; 467 | } 468 | 469 | + (void)handleOpenUrl:(NSURL *)url { 470 | [JSHAREService handleOpenUrl:url]; 471 | } 472 | #pragma mark - UIApplication delegate 473 | //目前适用所有 iOS 系统 474 | - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{ 475 | [JSHAREService handleOpenUrl:url]; 476 | return YES; 477 | } 478 | 479 | //仅支持 iOS9 以上系统,iOS8 及以下系统不会回调 480 | - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { 481 | [JSHAREService handleOpenUrl:url]; 482 | return YES; 483 | } 484 | @end 485 | -------------------------------------------------------------------------------- /ios/jshare_flutter_plugin.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'jshare_flutter_plugin' 6 | s.version = '0.0.1' 7 | s.summary = 'A new Flutter plugin.' 8 | s.description = <<-DESC 9 | A new Flutter plugin. 10 | DESC 11 | s.homepage = 'https://jiguang.cn' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'xudong.rao' => 'xudong.rao@outlook.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = 'Classes/**/*.h' 17 | s.dependency 'Flutter' 18 | s.dependency 'JShare' 19 | 20 | s.ios.deployment_target = '8.0' 21 | s.static_framework = true 22 | end 23 | 24 | -------------------------------------------------------------------------------- /jshare_flutter_plugin.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /lib/jshare_flutter_plugin.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:collection/collection.dart' show IterableExtension; 4 | import 'package:flutter/cupertino.dart'; 5 | import 'package:flutter/services.dart'; 6 | import 'package:flutter/foundation.dart'; 7 | import 'package:flutter/material.dart'; 8 | import 'dart:convert'; 9 | 10 | class JShare { 11 | final String flutterLog = "| JSHARE | Flutter | "; 12 | 13 | final MethodChannel _channel; 14 | 15 | factory JShare() => _instance; 16 | 17 | @visibleForTesting 18 | JShare.private(MethodChannel channel) : _channel = channel; 19 | static final _instance = 20 | new JShare.private(const MethodChannel("jshare_flutter_plugin")); 21 | 22 | /// 初始化 23 | void setup({JShareConfig? config}) { 24 | print(flutterLog + "setup:"); 25 | 26 | if (config == null) { 27 | return; 28 | } 29 | 30 | if (config.appKey == null) { 31 | print(flutterLog + "JIGUANG appkey can not be null"); 32 | return; 33 | } 34 | Map map = config.toJsonMap(); 35 | _channel.invokeListMethod("setup", map); 36 | } 37 | 38 | /// 分享, 39 | Future shareMessage({required JShareMessage message}) async { 40 | print(flutterLog + "shareMessage:" + message.toJsonMap().toString()); 41 | 42 | Map map = message.toJsonMap(); 43 | Map? resultMap = await (_channel.invokeMapMethod("shareMessage", map)); 44 | JShareResponse response = JShareResponse.fromJson(resultMap); 45 | 46 | return response; 47 | } 48 | 49 | /// 授权 50 | Future authorize({required JSharePlatform platform}) async { 51 | print(flutterLog + "authorize:"); 52 | 53 | Map map = Map(); 54 | map["platform"] = getStringFromEnum(platform); 55 | Map? resultMap = await (_channel.invokeMapMethod("authorize", map)); 56 | 57 | JShareSocial social = JShareSocial.fromJson(resultMap); 58 | 59 | print(flutterLog + "authorize callback:" + social.toJsonMap().toString()); 60 | 61 | return social; 62 | } 63 | 64 | /// 判断是否授权 65 | Future isPlatformAuth( 66 | {required JSharePlatform platform}) async { 67 | print(flutterLog + "isPlatformAuth:"); 68 | 69 | Map map = Map(); 70 | map["platform"] = getStringFromEnum(platform); 71 | Map? resultMap = 72 | await (_channel.invokeMapMethod("isPlatformAuth", map)); 73 | return JShareResponse.fromJson(resultMap); 74 | } 75 | 76 | /// 取消授权 77 | Future cancelPlatformAuth( 78 | {required JSharePlatform platform}) async { 79 | print(flutterLog + "cancelPlatformAuth:"); 80 | 81 | Map map = Map(); 82 | map["platform"] = getStringFromEnum(platform); 83 | Map? resultMap = 84 | await (_channel.invokeMapMethod("cancelPlatformAuth", map)); 85 | return JShareResponse.fromJson(resultMap); 86 | } 87 | 88 | /// 获取个人信息 89 | Future getUserInfo({required JSharePlatform platform}) async { 90 | print(flutterLog + "getUserInfo:"); 91 | 92 | Map map = Map(); 93 | map["platform"] = getStringFromEnum(platform); 94 | Map? resultMap = 95 | await (_channel.invokeMapMethod("getUserInfo", map)); 96 | JShareUserInfo userInfo = JShareUserInfo.fromJson(resultMap); 97 | 98 | print( 99 | flutterLog + "getUserInfo callback:" + userInfo.toJsonMap().toString()); 100 | return userInfo; 101 | } 102 | 103 | /// 判断某平台分享是否有效 104 | Future isClientValid({required JSharePlatform platform}) async { 105 | print(flutterLog + "isClientValid:"); 106 | 107 | Map map = Map(); 108 | map["platform"] = getStringFromEnum(platform); 109 | Map? resultMap = await (_channel.invokeMapMethod("isClientValid", map)); 110 | JShareResponse response = JShareResponse.fromJson(resultMap); 111 | if (response.code == JShareCode.success) { 112 | return true; 113 | } else { 114 | return false; 115 | } 116 | } 117 | } 118 | 119 | /// 初始化配置 120 | class JShareConfig { 121 | bool isDebug = false; 122 | String? channel; 123 | bool isAdvertisinId = false; 124 | bool isProduction = false; 125 | String? appKey; // 极光平台 AppKey 126 | String? weChatAppId; 127 | String? weChatAppSecret; 128 | String? qqAppId; 129 | String? qqAppKey; 130 | String? sinaWeiboAppKey; 131 | String? sinaWeiboAppSecret; 132 | String? sinaRedirectUri; 133 | String? facebookAppID; 134 | String? facebookDisplayName; 135 | String? twitterConsumerKey; 136 | String? twitterConsumerSecret; 137 | String? universalLink; 138 | 139 | JShareConfig({required String appKey}) { 140 | this.appKey = appKey; 141 | } 142 | 143 | Map toJsonMap() { 144 | return { 145 | "isDebug": isDebug, 146 | "channel": channel ??= null, 147 | "isAdvertisinId": isAdvertisinId, 148 | "isProduction": isProduction, 149 | "appKey": appKey ??= null, 150 | "weChatAppId": weChatAppId ??= null, 151 | "weChatAppSecret": weChatAppSecret ??= null, 152 | "qqAppId": qqAppId ??= null, 153 | "qqAppKey": qqAppKey ??= null, 154 | "sinaWeiboAppKey": sinaWeiboAppKey ??= null, 155 | "sinaWeiboAppSecret": sinaWeiboAppSecret ??= null, 156 | "sinaRedirectUri": sinaRedirectUri ??= null, 157 | "facebookAppID": facebookAppID ??= null, 158 | "facebookDisplayName": facebookDisplayName ??= null, 159 | "twitterConsumerKey": twitterConsumerKey ??= null, 160 | "twitterConsumerSecret": twitterConsumerSecret ??= null, 161 | "universalLink": universalLink ??= null, 162 | }..removeWhere((key, value) => value == null); 163 | } 164 | } 165 | 166 | class JShareResponse { 167 | JShareCode? code; 168 | 169 | /// 状态码 170 | String? message; 171 | 172 | /// 返回提示 173 | 174 | JShareResponse(); 175 | 176 | JShareResponse.fromJson(Map? json) 177 | : code = getEnumFromString(JShareCode.values, json?["code"]), 178 | message = json?["message"]; 179 | 180 | Map toJsonMap() { 181 | return { 182 | "code": getStringFromEnum(code), 183 | "message": message ??= null, 184 | }..removeWhere((key, value) => value == null); 185 | } 186 | } 187 | 188 | class JShareSocial extends JShareResponse { 189 | String? openid; 190 | String? token; 191 | String? refreshToken; 192 | String? expiration; 193 | Map? originData; 194 | 195 | JShareSocial.fromJson(Map? jsonMap) 196 | : openid = jsonMap?["openid"], 197 | token = jsonMap?["token"], 198 | refreshToken = jsonMap?["refreshToken"], 199 | expiration = jsonMap?["expiration"], 200 | originData = jsonMap?["originData"] != null 201 | ? json.decode(jsonMap?["originData"]) 202 | : null, 203 | super.fromJson(jsonMap); 204 | 205 | Map toJsonMap() { 206 | Map map = super.toJsonMap(); 207 | map.addAll({ 208 | "openid": openid ??= null, 209 | "token": token ??= null, 210 | "refreshToken": refreshToken ??= null, 211 | "expiration": expiration ??= null, 212 | "originData": originData ??= null, 213 | }); 214 | return map..removeWhere((key, value) => value == null); 215 | } 216 | } 217 | 218 | class JShareUserInfo extends JShareSocial { 219 | String? name; 220 | String? imageUrl; 221 | int? gender; 222 | 223 | JShareUserInfo.fromJson(Map? json) 224 | : name = json?["name"], 225 | imageUrl = json?["imageUrl"], 226 | gender = json?["gender"], 227 | super.fromJson(json); 228 | 229 | Map toJsonMap() { 230 | Map map = super.toJsonMap(); 231 | map.addAll({ 232 | "openid": openid ??= null, 233 | "token": token ??= null, 234 | "refreshToken": refreshToken ??= null, 235 | "expiration": expiration ??= null, 236 | "originData": originData ??= null, 237 | "name": name ??= null, 238 | "imageUrl": imageUrl ??= null, 239 | "gender": gender, 240 | }); 241 | return map..removeWhere((key, value) => value == null); 242 | } 243 | } 244 | 245 | class JShareMessage { 246 | /// 标题:长度每个平台的限制而不同 247 | String? title; 248 | 249 | /// 文本:文本内容,长度每个平台的限制而不同。在分享非文本类型时,此字段作为分享内容的描述使用 250 | String? text; 251 | 252 | /// 链接:根据媒体类型填入链接,长度每个平台的限制不同。分享非文本及非图片类型时,必要!(音乐跳转url、视频url、网页url) 253 | String? url; 254 | 255 | /// 图片路径 256 | String? imagePath; 257 | 258 | /// 本地视频:仅支持 QZone、Twitter、Facebook、Facebook Messenger, iOS 端要传 ALAsset的ALAssetPropertyAssetURL; 其他平台通过 url 分享视频 259 | String? videoPath; 260 | 261 | /// 分享 music 类型至微信平台或QQ平台时,音乐数据源url,点击可直接播放。 262 | String? musicDataUrl; 263 | 264 | /// 分享 App 类型至微信平台时,第三方程序自定义的简单数据,only for ios 265 | String? extInfo; 266 | 267 | /// 分享 File 或者 App 类型时,对应的File数据以及App数据,最大 10 M 268 | String? fileDataPath; 269 | 270 | /// 分享 File 类型至微信平台时,对应的文件后缀名,分享文件必填,否则会导致分享到微信平台出现不一致的文件类型,最大 64 字符,only for ios 271 | String? fileExt; 272 | 273 | /// 分享 Emoticon 类型至微信平台时,对应的表情数据,最大 10 M 274 | String? emoticonDataPath; 275 | 276 | /// 分享至新浪微博平台时,分享参数的一个标识符,默认为 “objectId”。最大 255 字符 277 | String? sinaObjectID; 278 | 279 | /// 微信小程序: 小程序username,如"gh_d43f693ca31f" 280 | String? miniProgramUserName; 281 | 282 | /// 微信小程序: 小程序页面路径,如"pages/page10000/page10000" 283 | String? miniProgramPath; 284 | 285 | /// 微信小程序: 小程序版本类型。 0正式版,1开发版,2体验版。默认0,正式版 286 | int miniProgramType = 0; 287 | 288 | /// 微信小程序: 是否使用带 shareTicket 的转发。默认false,不使用带 shareTicket 的转发 289 | bool miniProgramWithShareTicket = false; 290 | 291 | /// 分享的媒体类型。必要! 292 | JShareType? mediaType; 293 | 294 | /// 分享的目标平台。必要! 295 | JSharePlatform? platform; 296 | 297 | Map toJsonMap() { 298 | return { 299 | "title": title ??= null, 300 | "text": text ??= null, 301 | "url": url ??= null, 302 | "videoPath": videoPath ??= null, 303 | "imagePath": imagePath ??= null, 304 | "musicDataUrl": musicDataUrl ??= null, 305 | "extInfo": extInfo ??= null, 306 | "fileDataPath": fileDataPath ??= null, 307 | "fileExt": fileExt ??= null, 308 | "emoticonDataPath": emoticonDataPath ??= null, 309 | "sinaObjectID": sinaObjectID ??= null, 310 | "miniProgramUserName": miniProgramUserName ??= null, 311 | "miniProgramPath": miniProgramPath, 312 | "miniProgramType": miniProgramType, 313 | "miniProgramWithShareTicket": miniProgramWithShareTicket, 314 | "mediaType": getStringFromEnum(mediaType), 315 | "platform": getStringFromEnum(platform), 316 | }..removeWhere((key, value) => value == null); 317 | } 318 | } 319 | 320 | enum JSharePlatform { 321 | wechatSession, 322 | wechatTimeLine, 323 | wechatFavourite, 324 | qq, 325 | qZone, 326 | sinaWeibo, 327 | sinaWeiboContact, 328 | facebook, 329 | facebookMessenger, 330 | twitter 331 | } 332 | 333 | /// 接口的状态码, 334 | enum JShareCode { 335 | /// 成功 336 | success, 337 | 338 | /// 取消 339 | cancel, 340 | 341 | /// 失败 342 | fail 343 | } 344 | 345 | enum JShareType { 346 | text, 347 | image, 348 | link, 349 | audio, 350 | video, 351 | app, 352 | file, 353 | emoticon, 354 | miniProgram, 355 | } 356 | 357 | String? getStringFromEnum(T) { 358 | if (T == null) { 359 | return null; 360 | } 361 | 362 | return T.toString().split('.').last; 363 | } 364 | 365 | T? getEnumFromString(Iterable values, String? str) { 366 | return values.firstWhereOrNull((f) => f.toString().split('.').last == str); 367 | } 368 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "2.6.1" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "2.1.0" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "1.1.0" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.2.0" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.1.0" 39 | collection: 40 | dependency: "direct main" 41 | description: 42 | name: collection 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.15.0" 46 | fake_async: 47 | dependency: transitive 48 | description: 49 | name: fake_async 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "1.2.0" 53 | flutter: 54 | dependency: "direct main" 55 | description: flutter 56 | source: sdk 57 | version: "0.0.0" 58 | flutter_test: 59 | dependency: "direct dev" 60 | description: flutter 61 | source: sdk 62 | version: "0.0.0" 63 | matcher: 64 | dependency: transitive 65 | description: 66 | name: matcher 67 | url: "https://pub.flutter-io.cn" 68 | source: hosted 69 | version: "0.12.10" 70 | meta: 71 | dependency: transitive 72 | description: 73 | name: meta 74 | url: "https://pub.flutter-io.cn" 75 | source: hosted 76 | version: "1.3.0" 77 | path: 78 | dependency: transitive 79 | description: 80 | name: path 81 | url: "https://pub.flutter-io.cn" 82 | source: hosted 83 | version: "1.8.0" 84 | sky_engine: 85 | dependency: transitive 86 | description: flutter 87 | source: sdk 88 | version: "0.0.99" 89 | source_span: 90 | dependency: transitive 91 | description: 92 | name: source_span 93 | url: "https://pub.flutter-io.cn" 94 | source: hosted 95 | version: "1.8.1" 96 | stack_trace: 97 | dependency: transitive 98 | description: 99 | name: stack_trace 100 | url: "https://pub.flutter-io.cn" 101 | source: hosted 102 | version: "1.10.0" 103 | stream_channel: 104 | dependency: transitive 105 | description: 106 | name: stream_channel 107 | url: "https://pub.flutter-io.cn" 108 | source: hosted 109 | version: "2.1.0" 110 | string_scanner: 111 | dependency: transitive 112 | description: 113 | name: string_scanner 114 | url: "https://pub.flutter-io.cn" 115 | source: hosted 116 | version: "1.1.0" 117 | term_glyph: 118 | dependency: transitive 119 | description: 120 | name: term_glyph 121 | url: "https://pub.flutter-io.cn" 122 | source: hosted 123 | version: "1.2.0" 124 | test_api: 125 | dependency: transitive 126 | description: 127 | name: test_api 128 | url: "https://pub.flutter-io.cn" 129 | source: hosted 130 | version: "0.3.0" 131 | typed_data: 132 | dependency: transitive 133 | description: 134 | name: typed_data 135 | url: "https://pub.flutter-io.cn" 136 | source: hosted 137 | version: "1.3.0" 138 | vector_math: 139 | dependency: transitive 140 | description: 141 | name: vector_math 142 | url: "https://pub.flutter-io.cn" 143 | source: hosted 144 | version: "2.1.0" 145 | sdks: 146 | dart: ">=2.12.0 <3.0.0" 147 | flutter: ">=1.20.0" 148 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: jshare_flutter_plugin 2 | description: JIGUANG officially supported JShare SDK Flutter plugin (Android & iOS). 极光分享官方支持的 Flutter 插件(Android & iOS). 3 | version: 2.1.2 4 | homepage: https://www.jiguang.cn 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | flutter: ">=1.20.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | collection: ^1.15.0 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | 19 | # For information on the generic Dart part of this file, see the 20 | # following page: https://dart.dev/tools/pub/pubspec 21 | 22 | # The following section is specific to Flutter. 23 | flutter: 24 | plugin: 25 | platforms: 26 | android: 27 | package: cn.jiguang.jshare_flutter_plugin 28 | pluginClass: JshareFlutterPlugin 29 | ios: 30 | pluginClass: JshareFlutterPlugin 31 | 32 | # To add assets to your plugin package, add an assets section, like this: 33 | # assets: 34 | # - images/a_dot_burr.jpeg 35 | # - images/a_dot_ham.jpeg 36 | # 37 | # For details regarding assets in packages, see 38 | # https://flutter.dev/assets-and-images/#from-packages 39 | # 40 | # An image asset can refer to one or more resolution-specific "variants", see 41 | # https://flutter.dev/assets-and-images/#resolution-aware. 42 | 43 | # To add custom fonts to your plugin package, add a fonts section here, 44 | # in this "flutter" section. Each entry in this list should have a 45 | # "family" key with the font family name, and a "fonts" key with a 46 | # list giving the asset and other descriptors for the font. For 47 | # example: 48 | # fonts: 49 | # - family: Schyler 50 | # fonts: 51 | # - asset: fonts/Schyler-Regular.ttf 52 | # - asset: fonts/Schyler-Italic.ttf 53 | # style: italic 54 | # - family: Trajan Pro 55 | # fonts: 56 | # - asset: fonts/TrajanPro.ttf 57 | # - asset: fonts/TrajanPro_Bold.ttf 58 | # weight: 700 59 | # 60 | # For details regarding fonts in packages, see 61 | # https://flutter.dev/custom-fonts/#from-packages 62 | -------------------------------------------------------------------------------- /res/set_ios_scheme.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/res/set_ios_scheme.jpg -------------------------------------------------------------------------------- /res/set_ios_scheme2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/res/set_ios_scheme2.png -------------------------------------------------------------------------------- /res/set_wxapi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpush/jshare-flutter-plugin/441127a0d5c215ffb196462e8e0d88234705ce61/res/set_wxapi.png -------------------------------------------------------------------------------- /test/jshare_flutter_plugin_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:jshare_flutter_plugin/jshare_flutter_plugin.dart'; 4 | 5 | void main() { 6 | const MethodChannel channel = MethodChannel('jshare_flutter_plugin'); 7 | 8 | setUp(() { 9 | channel.setMockMethodCallHandler((MethodCall methodCall) async { 10 | return '42'; 11 | }); 12 | }); 13 | 14 | tearDown(() { 15 | channel.setMockMethodCallHandler(null); 16 | }); 17 | 18 | 19 | } 20 | --------------------------------------------------------------------------------