├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── kotlin │ └── com │ └── jarvanmo │ └── sona │ ├── SonaPlugin.kt │ ├── constants │ └── constant.kt │ ├── handler │ ├── ReceiverHandler.kt │ └── RegisterHandler.kt │ └── service │ ├── SonaPushService.kt │ └── SonaReceiverService.kt ├── arts └── logo.png ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── jarvanmo │ │ │ │ └── sonaexample │ │ │ │ └── MainActivity.kt │ │ │ └── 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 │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── 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 │ │ ├── Runner.entitlements │ │ └── main.m ├── lib │ └── main.dart ├── pubspec.yaml └── test │ └── widget_test.dart ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── SonaPlugin.m │ ├── handler │ │ ├── RegisterHandler.h │ │ └── RegisterHandler.m │ ├── helper │ │ ├── SonaStringUtil.h │ │ └── SonaStringUtil.m │ └── public │ │ └── SonaPlugin.h └── sona.podspec ├── lib ├── sona.dart └── src │ ├── sdk_status.dart │ ├── son_data_model.dart │ └── sona_iml.dart └── pubspec.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | pubspec.lock 7 | 8 | build/ 9 | *.iml 10 | .idea/ 11 | 12 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.9+2 2 | 3 | * 支持setBadge(仅iOS)。 4 | 5 | ## 0.0.9+1 6 | 7 | * fix #10 8 | 9 | ## 0.0.9 10 | * 增加对onNotificationMessageArrived的监听。 11 | 12 | ## 0.0.8 13 | * 增加点击通知栏动作(仅Android)。 14 | 15 | ## 0.0.7 16 | * 隐藏RegisterGetuiPushModel。 17 | 18 | ## 0.0.6 19 | * kotlin升级至1.3.11。 20 | * 部分api调整。 21 | * Android部分SDK升级到2.13.0.0。 22 | 23 | ## 0.0.5 24 | * 修复android自定义权限问题(#9)。 25 | * 升级kotlin至1.3.0 26 | 27 | ## 0.0.3 28 | * 修复iOS与其他库共存时,会有重复的错误 29 | 30 | ## 0.0.3 31 | * 升级android部分所使用的技术 32 | * 修复在flutter-0.9.7+上的*Expected type mismatch* 33 | 34 | ## 0.0.2 35 | * 增加了iOS获取clientID。 36 | * 修复在android注册报错的问题。 37 | 38 | ## 0.0.1 39 | 40 | * initial release. 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![logo](./arts/logo.png) [![pub package](https://img.shields.io/pub/v/sona.svg)](https://pub.dartlang.org/packages/sona) 2 | 3 | sona makes possible using getui push in flutter. 4 | 5 | # @Deprecated 6 | 7 | This lib won't be updated.Devleopers should visit [the official flutter plugin](https://github.com/GetuiLaboratory/getui-flutter-plugin) 8 | for help. 9 | 10 | ## 简介 11 | `Sona`是个推推送SDK在`Flutter`上的实现。通过`Sona`,可以在Flutter上轻松使用个推推送。 12 | 使用`Sona`之前,请到个推官网进行应用注册。 13 | 14 | 15 | ## 初始化 16 | 鉴于`Android`和`iOS`的差异化,对应平台设置还需手动设置,具体请参考[官网](http://docs.getui.com/getui/mobile/android/androidstudio_maven/)。 17 | 在`Flutter`中通过`Sona`初使化个推推送: 18 | ```dart 19 | import 'package:sona/sona.dart' as sona; 20 | sona.register( 21 | appID: "your app id", 22 | appKey: "your app key", 23 | appSecret: "app secret" 24 | ); 25 | ``` 26 | `appID`,`appKey`,`appSecret`目前仅在`iOS`上生效,因为在`android`上,这些配置是在`build.gradle`中完成的,所以使用`Sona`之前 27 | 一定要在`android`工程配置`appID`、`appKey`以及`appSecret`: 28 | ``` 29 | defaultConfig { 30 | //some configrations 31 | 32 | manifestPlaceholders = [ 33 | GETUI_APP_ID : "APP_ID", 34 | GETUI_APP_KEY : "APP_KEY", 35 | GETUI_APP_SECRET : "APP_SECRET" 36 | ] 37 | } 38 | ``` 39 | 40 | ## 接收透传 41 | 通过监听`receivedMessageData`可以获取个推推送的透传数据: 42 | ```dart 43 | sona.receivedMessageData.listen((payload){ 44 | //接收到透传 45 | }); 46 | ``` 47 | 其中*payload*为`Map`根据平台不台,其包含的key也不同: 48 | - appID:String 49 | - taskID:String 50 | - messageID:String 51 | - offLine:bool 52 | - payload:String or null 53 | - pkgName:String,仅安卓平台 54 | 55 | 56 | -------------------------------------------------------------------------------- /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 'com.jarvanmo.sona' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | ext.kotlin_version = '1.3.31' 6 | repositories { 7 | google() 8 | jcenter() 9 | } 10 | 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:3.4.0' 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | rootProject.allprojects { 18 | repositories { 19 | google() 20 | jcenter() 21 | maven { 22 | url "http://mvn.gt.igexin.com/nexus/content/repositories/releases/" 23 | } 24 | } 25 | } 26 | 27 | apply plugin: 'com.android.library' 28 | apply plugin: 'kotlin-android' 29 | 30 | android { 31 | compileSdkVersion 28 32 | 33 | sourceSets { 34 | main.java.srcDirs += 'src/main/kotlin' 35 | } 36 | defaultConfig { 37 | minSdkVersion 16 38 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 39 | } 40 | lintOptions { 41 | disable 'InvalidPackage' 42 | } 43 | } 44 | 45 | dependencies { 46 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 47 | api 'com.getui:sdk:2.13.0.0' 48 | } 49 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'sona' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /android/src/main/kotlin/com/jarvanmo/sona/SonaPlugin.kt: -------------------------------------------------------------------------------- 1 | package com.jarvanmo.sona 2 | 3 | import com.igexin.sdk.PushManager 4 | import com.jarvanmo.sona.constants.ALIAS 5 | import com.jarvanmo.sona.handler.ReceiverHandler 6 | import com.jarvanmo.sona.handler.RegisterHandler 7 | import io.flutter.plugin.common.MethodCall 8 | import io.flutter.plugin.common.MethodChannel 9 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler 10 | import io.flutter.plugin.common.MethodChannel.Result 11 | import io.flutter.plugin.common.PluginRegistry.Registrar 12 | 13 | class SonaPlugin(private val registrar: Registrar) : MethodCallHandler { 14 | companion object { 15 | @JvmStatic 16 | fun registerWith(registrar: Registrar): Unit { 17 | val channel = MethodChannel(registrar.messenger(), "com.jarvanmo/sona") 18 | ReceiverHandler.methodChannel = channel 19 | channel.setMethodCallHandler(SonaPlugin(registrar)) 20 | } 21 | } 22 | 23 | private val registerHandler: RegisterHandler = RegisterHandler(registrar) 24 | 25 | override fun onMethodCall(call: MethodCall, result: Result): Unit { 26 | when { 27 | call.method == "registerGeTui" -> registerHandler.register(call, result) 28 | "clientID" == call.method -> { 29 | val clientID = PushManager.getInstance().getClientid(registrar.context().applicationContext) 30 | result.success(clientID) 31 | } 32 | 33 | "turnOnPush" == call.method -> { 34 | val isOn:Boolean = call.arguments() 35 | if (isOn) { 36 | PushManager.getInstance().turnOnPush(registrar.context().applicationContext) 37 | }else { 38 | PushManager.getInstance().turnOffPush(registrar.context().applicationContext) 39 | } 40 | 41 | result.success(true) 42 | } 43 | 44 | 45 | "bindAlias" == call.method ->bindAlias(call,result) 46 | "unBindAlias" == call.method -> unBindAlias(call,result) 47 | else -> result.notImplemented() 48 | } 49 | } 50 | 51 | private fun bindAlias(call: MethodCall, result: Result){ 52 | val sn:String? = call.argument("sequenceNum") 53 | if(sn.isNullOrBlank()){ 54 | val ok = PushManager.getInstance().bindAlias(registrar.context().applicationContext,call.argument(ALIAS)) 55 | result.success(ok) 56 | }else{ 57 | val ok =PushManager.getInstance().bindAlias(registrar.context().applicationContext,call.argument(ALIAS),sn) 58 | result.success(ok) 59 | } 60 | 61 | } 62 | 63 | private fun unBindAlias(call: MethodCall, result: Result){ 64 | val context = registrar.context().applicationContext 65 | val alias = call.argument(ALIAS) 66 | val sn:String? = call.argument("sequenceNum") 67 | if(sn.isNullOrBlank()) { 68 | val ok = PushManager.getInstance().unBindAlias(context,alias,call.argument("isSelf")?:false) 69 | result.success(ok) 70 | }else{ 71 | val ok = PushManager.getInstance().unBindAlias(context,alias,call.argument("isSelf")?:false,sn) 72 | result.success(ok) 73 | } 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /android/src/main/kotlin/com/jarvanmo/sona/constants/constant.kt: -------------------------------------------------------------------------------- 1 | package com.jarvanmo.sona.constants 2 | 3 | internal const val PLATFORM = "platform" 4 | internal const val ANDROID = "android" 5 | internal const val RESULT = "result" 6 | 7 | internal const val APP_ID ="appID" 8 | internal const val TASK_ID ="taskID" 9 | internal const val MESSAGE_ID ="messageID" 10 | internal const val PAYLOAD ="payload" 11 | internal const val PKG_NAME ="pkgName" 12 | internal const val CLIENT_ID = "clientID" 13 | internal const val CONTENT = "content" 14 | internal const val TITLE ="title" 15 | internal const val ALIAS = "alias" 16 | -------------------------------------------------------------------------------- /android/src/main/kotlin/com/jarvanmo/sona/handler/ReceiverHandler.kt: -------------------------------------------------------------------------------- 1 | package com.jarvanmo.sona.handler 2 | 3 | 4 | import com.igexin.sdk.message.GTNotificationMessage 5 | import com.igexin.sdk.message.GTTransmitMessage 6 | import com.jarvanmo.sona.constants.* 7 | import io.flutter.plugin.common.MethodChannel 8 | 9 | object ReceiverHandler { 10 | 11 | var methodChannel: MethodChannel? = null 12 | 13 | fun handleReceivedMessageData(msg: GTTransmitMessage) { 14 | 15 | val result = hashMapOf( 16 | APP_ID to msg.appid, 17 | MESSAGE_ID to msg.messageId, 18 | TASK_ID to msg.taskId, 19 | PKG_NAME to msg.pkgName, 20 | CLIENT_ID to msg.clientId 21 | ) 22 | 23 | val payload = msg.payload 24 | if (payload != null) { 25 | result[PAYLOAD] = String(payload) 26 | } 27 | methodChannel?.invokeMethod("onReceiveMessageData", result) 28 | 29 | } 30 | 31 | 32 | fun onReceiveClientId(clientID: String) { 33 | methodChannel?.invokeMethod("onReceiveClientId", clientID) 34 | } 35 | 36 | fun onReceiveOnlineState(isOnline: Boolean) { 37 | if (isOnline) { 38 | methodChannel?.invokeMethod("onReceiveOnlineState", "STARTED") 39 | } else { 40 | methodChannel?.invokeMethod("onReceiveOnlineState","OFFLINE") 41 | } 42 | 43 | } 44 | 45 | fun onNotificationMessageArrived(msg: GTNotificationMessage){ 46 | 47 | val result = hashMapOf( 48 | PLATFORM to ANDROID, 49 | APP_ID to msg.appid, 50 | MESSAGE_ID to msg.messageId, 51 | TASK_ID to msg.taskId, 52 | PKG_NAME to msg.pkgName, 53 | CLIENT_ID to msg.clientId, 54 | CONTENT to msg.content, 55 | TITLE to msg.title 56 | ) 57 | 58 | methodChannel?.invokeMethod("onNotificationMessageArrived",result) 59 | 60 | } 61 | 62 | fun onNotificationMessageClicked(msg: GTNotificationMessage){ 63 | val result = hashMapOf( 64 | PLATFORM to ANDROID, 65 | APP_ID to msg.appid, 66 | MESSAGE_ID to msg.messageId, 67 | TASK_ID to msg.taskId, 68 | PKG_NAME to msg.pkgName, 69 | CLIENT_ID to msg.clientId, 70 | CONTENT to msg.content, 71 | TITLE to msg.title 72 | ) 73 | 74 | methodChannel?.invokeMethod("onNotificationMessageClicked",result) 75 | } 76 | } -------------------------------------------------------------------------------- /android/src/main/kotlin/com/jarvanmo/sona/handler/RegisterHandler.kt: -------------------------------------------------------------------------------- 1 | package com.jarvanmo.sona.handler 2 | 3 | import android.app.Service 4 | import com.igexin.sdk.PushManager 5 | import com.jarvanmo.sona.constants.ANDROID 6 | import com.jarvanmo.sona.constants.PLATFORM 7 | import com.jarvanmo.sona.constants.RESULT 8 | import com.jarvanmo.sona.service.SonaPushService 9 | import com.jarvanmo.sona.service.SonaReceiverService 10 | import io.flutter.plugin.common.MethodCall 11 | import io.flutter.plugin.common.MethodChannel 12 | import io.flutter.plugin.common.PluginRegistry.Registrar 13 | 14 | internal class RegisterHandler(private val registrar: Registrar) { 15 | 16 | 17 | fun register(call: MethodCall, result: MethodChannel.Result) { 18 | val needRegister = call.argument("registerOnAndroid")?:true 19 | if (!needRegister) { 20 | result.success(mapOf( PLATFORM to ANDROID, 21 | RESULT to true)) 22 | return 23 | } 24 | 25 | val serviceName: String? = call.argument("pushServiceName") 26 | var serviceClass: Class = SonaPushService::class.java 27 | if (serviceName.isNullOrBlank()) { 28 | PushManager.getInstance().initialize(registrar.context().applicationContext, serviceClass) 29 | PushManager.getInstance().registerPushIntentService(registrar.context().applicationContext, SonaReceiverService::class.java) 30 | result.success(mapOf( 31 | PLATFORM to ANDROID, 32 | RESULT to true 33 | )) 34 | return 35 | } 36 | 37 | try { 38 | serviceClass = Class.forName(serviceName) as Class 39 | PushManager.getInstance().initialize(registrar.context().applicationContext, serviceClass) 40 | result.success(mapOf( 41 | PLATFORM to ANDROID, 42 | RESULT to true 43 | )) 44 | } catch (e: ClassNotFoundException) { 45 | result.error("ClassNotFoundException","Can't find class $serviceName.stacktrace from android:\n ${e.message}",serviceName) 46 | } catch (e: ClassCastException) { 47 | result.error("ClassCastException","The class name given is not a sub type of android.app.Service. Here's stacktrace from android:\n${e.message}",serviceName) 48 | } 49 | 50 | 51 | } 52 | } -------------------------------------------------------------------------------- /android/src/main/kotlin/com/jarvanmo/sona/service/SonaPushService.kt: -------------------------------------------------------------------------------- 1 | package com.jarvanmo.sona.service 2 | 3 | import android.app.Service 4 | import android.content.Intent 5 | import android.os.IBinder 6 | import com.igexin.sdk.GTServiceManager 7 | 8 | 9 | 10 | class SonaPushService : Service() { 11 | override fun onCreate() { 12 | super.onCreate() 13 | GTServiceManager.getInstance().onCreate(this) 14 | } 15 | 16 | override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int { 17 | super.onStartCommand(intent, flags, startId) 18 | return GTServiceManager.getInstance().onStartCommand(this, intent, flags, startId) 19 | } 20 | 21 | override fun onBind(intent: Intent): IBinder? { 22 | return GTServiceManager.getInstance().onBind(intent) 23 | } 24 | 25 | override fun onDestroy() { 26 | super.onDestroy() 27 | GTServiceManager.getInstance().onDestroy() 28 | } 29 | 30 | override fun onLowMemory() { 31 | super.onLowMemory() 32 | GTServiceManager.getInstance().onLowMemory() 33 | } 34 | } -------------------------------------------------------------------------------- /android/src/main/kotlin/com/jarvanmo/sona/service/SonaReceiverService.kt: -------------------------------------------------------------------------------- 1 | package com.jarvanmo.sona.service 2 | 3 | import android.content.Context 4 | import com.igexin.sdk.GTIntentService 5 | import com.igexin.sdk.message.GTCmdMessage 6 | import com.igexin.sdk.message.GTNotificationMessage 7 | import com.igexin.sdk.message.GTTransmitMessage 8 | import com.jarvanmo.sona.handler.ReceiverHandler 9 | 10 | class SonaReceiverService : GTIntentService() { 11 | override fun onReceiveMessageData(p0: Context, p1: GTTransmitMessage) { 12 | ReceiverHandler.handleReceivedMessageData(p1) 13 | } 14 | 15 | override fun onNotificationMessageArrived(p0: Context, p1: GTNotificationMessage) { 16 | ReceiverHandler.onNotificationMessageArrived(p1) 17 | } 18 | 19 | override fun onReceiveServicePid(p0: Context, p1: Int) { 20 | } 21 | 22 | override fun onNotificationMessageClicked(p0: Context, p1: GTNotificationMessage) { 23 | ReceiverHandler.onNotificationMessageClicked(p1) 24 | } 25 | 26 | override fun onReceiveCommandResult(p0: Context, p1: GTCmdMessage?) { 27 | } 28 | 29 | override fun onReceiveClientId(p0: Context, p1: String) { 30 | ReceiverHandler.onReceiveClientId(p1) 31 | } 32 | 33 | override fun onReceiveOnlineState(p0: Context, p1: Boolean) { 34 | ReceiverHandler.onReceiveOnlineState(p1) 35 | } 36 | } -------------------------------------------------------------------------------- /arts/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/arts/logo.png -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | .flutter-plugins 10 | -------------------------------------------------------------------------------- /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: 3b309bda072a6b326e8aa4591a5836af600923ce 8 | channel: beta 9 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # sona_example 2 | 3 | Demonstrates how to use the sona plugin. 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter, view our online 8 | [documentation](https://flutter.io/). 9 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.class 3 | .gradle 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | GeneratedPluginRegistrant.java 11 | -------------------------------------------------------------------------------- /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 plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.jarvanmo.sonaexample" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 47 | 48 | manifestPlaceholders = [ 49 | GETUI_APP_ID : "APP_ID", 50 | GETUI_APP_KEY : "APP_KEY", 51 | GETUI_APP_SECRET : "APP_SECRET" 52 | ] 53 | } 54 | 55 | buildTypes { 56 | release { 57 | // TODO: Add your own signing config for the release build. 58 | // Signing with the debug keys for now, so `flutter run --release` works. 59 | signingConfig signingConfigs.debug 60 | 61 | ndk { 62 | // 设置支持的SO库架构 63 | abiFilters 'armeabi-v7a' 64 | } 65 | } 66 | 67 | debug{ 68 | // ndk { 69 | // abiFilters 'armeabi','x86_64','x86' 70 | // } 71 | } 72 | 73 | 74 | } 75 | } 76 | 77 | flutter { 78 | source '../..' 79 | } 80 | 81 | dependencies { 82 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 83 | testImplementation 'junit:junit:4.12' 84 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 85 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 86 | } 87 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 20 | 27 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/jarvanmo/sonaexample/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.jarvanmo.sonaexample 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity(): FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | GeneratedPluginRegistrant.registerWith(this) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.31' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.4.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | // // maven库 19 | // def cn = "http://maven.aliyun.com/nexus/content/groups/public/" 20 | // def abroad = "http://central.maven.org/maven2/" 21 | // // 先从url中下载jar若没有找到,则在artifactUrls中寻找 22 | // maven { 23 | // url cn 24 | // artifactUrls abroad 25 | // } 26 | } 27 | } 28 | 29 | rootProject.buildDir = '../build' 30 | subprojects { 31 | project.buildDir = "${rootProject.buildDir}/${project.name}" 32 | } 33 | subprojects { 34 | project.evaluationDependsOn(':app') 35 | } 36 | 37 | task clean(type: Delete) { 38 | delete rootProject.buildDir 39 | } 40 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon May 13 10:16:48 CST 2019 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-5.1.1-all.zip 7 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /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/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/app.flx 37 | /Flutter/app.zip 38 | /Flutter/flutter_assets/ 39 | /Flutter/App.framework 40 | /Flutter/Flutter.framework 41 | /Flutter/Generated.xcconfig 42 | /ServiceDefinitions.json 43 | 44 | Pods/ 45 | .symlinks/ 46 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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/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 | def parse_KV_file(file, separator='=') 8 | file_abs_path = File.expand_path(file) 9 | if !File.exists? file_abs_path 10 | return []; 11 | end 12 | pods_ary = [] 13 | skip_line_start_symbols = ["#", "/"] 14 | File.foreach(file_abs_path) { |line| 15 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 16 | plugin = line.split(pattern=separator) 17 | if plugin.length == 2 18 | podname = plugin[0].strip() 19 | path = plugin[1].strip() 20 | podpath = File.expand_path("#{path}", file_abs_path) 21 | pods_ary.push({:name => podname, :path => podpath}); 22 | else 23 | puts "Invalid plugin specification: #{line}" 24 | end 25 | } 26 | return pods_ary 27 | end 28 | 29 | target 'Runner' do 30 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 31 | # referring to absolute paths on developers' machines. 32 | system('rm -rf .symlinks') 33 | system('mkdir -p .symlinks/plugins') 34 | 35 | # Flutter Pods 36 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') 37 | if generated_xcode_build_settings.empty? 38 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." 39 | end 40 | generated_xcode_build_settings.map { |p| 41 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR' 42 | symlink = File.join('.symlinks', 'flutter') 43 | File.symlink(File.dirname(p[:path]), symlink) 44 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) 45 | end 46 | } 47 | 48 | # Plugin Pods 49 | plugin_pods = parse_KV_file('../.flutter-plugins') 50 | plugin_pods.map { |p| 51 | symlink = File.join('.symlinks', 'plugins', p[:name]) 52 | File.symlink(p[:path], symlink) 53 | pod p[:name], :path => File.join(symlink, 'ios') 54 | } 55 | end 56 | 57 | post_install do |installer| 58 | installer.pods_project.targets.each do |target| 59 | target.build_configurations.each do |config| 60 | config.build_settings['ENABLE_BITCODE'] = 'NO' 61 | end 62 | end 63 | end 64 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - GTSDK (2.3.0.0) 4 | - sona (0.0.1): 5 | - Flutter 6 | - GTSDK 7 | 8 | DEPENDENCIES: 9 | - Flutter (from `.symlinks/flutter/ios`) 10 | - sona (from `.symlinks/plugins/sona/ios`) 11 | 12 | SPEC REPOS: 13 | https://github.com/cocoapods/specs.git: 14 | - GTSDK 15 | 16 | EXTERNAL SOURCES: 17 | Flutter: 18 | :path: ".symlinks/flutter/ios" 19 | sona: 20 | :path: ".symlinks/plugins/sona/ios" 21 | 22 | SPEC CHECKSUMS: 23 | Flutter: 9d0fac939486c9aba2809b7982dfdbb47a7b0296 24 | GTSDK: 16f570807190eca9846653886a1f399cb0485061 25 | sona: 394d2c73861688731eb18c7c4f21b1d19c142921 26 | 27 | PODFILE CHECKSUM: ff43a125c660fe8e1edaf17e3e7aa37bb5a2cc87 28 | 29 | COCOAPODS: 1.5.3 30 | -------------------------------------------------------------------------------- /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 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 15 | 68AD0BA3F052A998414AEDBF /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EE50AABFE3FB896E836B1772 /* libPods-Runner.a */; }; 16 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 17 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 18 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 19 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 20 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 21 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 22 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 23 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 24 | CD0FF21B21464BD100706C2F /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = CD0FF21A21464BD100706C2F /* libsqlite3.tbd */; }; 25 | CD0FF21D21464BD900706C2F /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = CD0FF21C21464BD900706C2F /* libz.tbd */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXCopyFilesBuildPhase section */ 29 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 30 | isa = PBXCopyFilesBuildPhase; 31 | buildActionMask = 2147483647; 32 | dstPath = ""; 33 | dstSubfolderSpec = 10; 34 | files = ( 35 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 36 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 37 | ); 38 | name = "Embed Frameworks"; 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXCopyFilesBuildPhase section */ 42 | 43 | /* Begin PBXFileReference section */ 44 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 45 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 46 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; 47 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 48 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 49 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 50 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 51 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 52 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 53 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 54 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 55 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 57 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 58 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 59 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 60 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 61 | CD0FF21A21464BD100706C2F /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; }; 62 | CD0FF21C21464BD900706C2F /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 63 | EE50AABFE3FB896E836B1772 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | /* End PBXFileReference section */ 65 | 66 | /* Begin PBXFrameworksBuildPhase section */ 67 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | CD0FF21D21464BD900706C2F /* libz.tbd in Frameworks */, 72 | CD0FF21B21464BD100706C2F /* libsqlite3.tbd in Frameworks */, 73 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 74 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 75 | 68AD0BA3F052A998414AEDBF /* libPods-Runner.a in Frameworks */, 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | /* End PBXFrameworksBuildPhase section */ 80 | 81 | /* Begin PBXGroup section */ 82 | 4ECFDA16F99F466B1FF3BAAB /* Frameworks */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | CD0FF21C21464BD900706C2F /* libz.tbd */, 86 | CD0FF21A21464BD100706C2F /* libsqlite3.tbd */, 87 | EE50AABFE3FB896E836B1772 /* libPods-Runner.a */, 88 | ); 89 | name = Frameworks; 90 | sourceTree = ""; 91 | }; 92 | 9740EEB11CF90186004384FC /* Flutter */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, 96 | 3B80C3931E831B6300D905FE /* App.framework */, 97 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 98 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 99 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 100 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 101 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 102 | ); 103 | name = Flutter; 104 | sourceTree = ""; 105 | }; 106 | 97C146E51CF9000F007C117D = { 107 | isa = PBXGroup; 108 | children = ( 109 | 9740EEB11CF90186004384FC /* Flutter */, 110 | 97C146F01CF9000F007C117D /* Runner */, 111 | 97C146EF1CF9000F007C117D /* Products */, 112 | BBF8A7514380F5D7A69DCD94 /* Pods */, 113 | 4ECFDA16F99F466B1FF3BAAB /* Frameworks */, 114 | ); 115 | sourceTree = ""; 116 | }; 117 | 97C146EF1CF9000F007C117D /* Products */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 97C146EE1CF9000F007C117D /* Runner.app */, 121 | ); 122 | name = Products; 123 | sourceTree = ""; 124 | }; 125 | 97C146F01CF9000F007C117D /* Runner */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 129 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 130 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 131 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 132 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 133 | 97C147021CF9000F007C117D /* Info.plist */, 134 | 97C146F11CF9000F007C117D /* Supporting Files */, 135 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 136 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 137 | ); 138 | path = Runner; 139 | sourceTree = ""; 140 | }; 141 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 97C146F21CF9000F007C117D /* main.m */, 145 | ); 146 | name = "Supporting Files"; 147 | sourceTree = ""; 148 | }; 149 | BBF8A7514380F5D7A69DCD94 /* Pods */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | ); 153 | name = Pods; 154 | sourceTree = ""; 155 | }; 156 | /* End PBXGroup section */ 157 | 158 | /* Begin PBXNativeTarget section */ 159 | 97C146ED1CF9000F007C117D /* Runner */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 162 | buildPhases = ( 163 | 0DD4DBF29DE598FF97610B4B /* [CP] Check Pods Manifest.lock */, 164 | 9740EEB61CF901F6004384FC /* Run Script */, 165 | 97C146EA1CF9000F007C117D /* Sources */, 166 | 97C146EB1CF9000F007C117D /* Frameworks */, 167 | 97C146EC1CF9000F007C117D /* Resources */, 168 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 169 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 170 | 4C48F86CFF434882F64DF775 /* [CP] Embed Pods Frameworks */, 171 | ); 172 | buildRules = ( 173 | ); 174 | dependencies = ( 175 | ); 176 | name = Runner; 177 | productName = Runner; 178 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 179 | productType = "com.apple.product-type.application"; 180 | }; 181 | /* End PBXNativeTarget section */ 182 | 183 | /* Begin PBXProject section */ 184 | 97C146E61CF9000F007C117D /* Project object */ = { 185 | isa = PBXProject; 186 | attributes = { 187 | LastUpgradeCheck = 0910; 188 | ORGANIZATIONNAME = "The Chromium Authors"; 189 | TargetAttributes = { 190 | 97C146ED1CF9000F007C117D = { 191 | CreatedOnToolsVersion = 7.3.1; 192 | DevelopmentTeam = 8JJXUFV6F7; 193 | }; 194 | }; 195 | }; 196 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 197 | compatibilityVersion = "Xcode 3.2"; 198 | developmentRegion = English; 199 | hasScannedForEncodings = 0; 200 | knownRegions = ( 201 | en, 202 | Base, 203 | ); 204 | mainGroup = 97C146E51CF9000F007C117D; 205 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 206 | projectDirPath = ""; 207 | projectRoot = ""; 208 | targets = ( 209 | 97C146ED1CF9000F007C117D /* Runner */, 210 | ); 211 | }; 212 | /* End PBXProject section */ 213 | 214 | /* Begin PBXResourcesBuildPhase section */ 215 | 97C146EC1CF9000F007C117D /* Resources */ = { 216 | isa = PBXResourcesBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 220 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 221 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 222 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 223 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, 224 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | /* End PBXResourcesBuildPhase section */ 229 | 230 | /* Begin PBXShellScriptBuildPhase section */ 231 | 0DD4DBF29DE598FF97610B4B /* [CP] Check Pods Manifest.lock */ = { 232 | isa = PBXShellScriptBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | ); 236 | inputPaths = ( 237 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 238 | "${PODS_ROOT}/Manifest.lock", 239 | ); 240 | name = "[CP] Check Pods Manifest.lock"; 241 | outputPaths = ( 242 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 243 | ); 244 | runOnlyForDeploymentPostprocessing = 0; 245 | shellPath = /bin/sh; 246 | 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"; 247 | showEnvVarsInLog = 0; 248 | }; 249 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 250 | isa = PBXShellScriptBuildPhase; 251 | buildActionMask = 2147483647; 252 | files = ( 253 | ); 254 | inputPaths = ( 255 | ); 256 | name = "Thin Binary"; 257 | outputPaths = ( 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | shellPath = /bin/sh; 261 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 262 | }; 263 | 4C48F86CFF434882F64DF775 /* [CP] Embed Pods Frameworks */ = { 264 | isa = PBXShellScriptBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | ); 268 | inputPaths = ( 269 | "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 270 | "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", 271 | ); 272 | name = "[CP] Embed Pods Frameworks"; 273 | outputPaths = ( 274 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 275 | ); 276 | runOnlyForDeploymentPostprocessing = 0; 277 | shellPath = /bin/sh; 278 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 279 | showEnvVarsInLog = 0; 280 | }; 281 | 9740EEB61CF901F6004384FC /* Run Script */ = { 282 | isa = PBXShellScriptBuildPhase; 283 | buildActionMask = 2147483647; 284 | files = ( 285 | ); 286 | inputPaths = ( 287 | ); 288 | name = "Run Script"; 289 | outputPaths = ( 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | shellPath = /bin/sh; 293 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 294 | }; 295 | /* End PBXShellScriptBuildPhase section */ 296 | 297 | /* Begin PBXSourcesBuildPhase section */ 298 | 97C146EA1CF9000F007C117D /* Sources */ = { 299 | isa = PBXSourcesBuildPhase; 300 | buildActionMask = 2147483647; 301 | files = ( 302 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 303 | 97C146F31CF9000F007C117D /* main.m in Sources */, 304 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 305 | ); 306 | runOnlyForDeploymentPostprocessing = 0; 307 | }; 308 | /* End PBXSourcesBuildPhase section */ 309 | 310 | /* Begin PBXVariantGroup section */ 311 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 312 | isa = PBXVariantGroup; 313 | children = ( 314 | 97C146FB1CF9000F007C117D /* Base */, 315 | ); 316 | name = Main.storyboard; 317 | sourceTree = ""; 318 | }; 319 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 320 | isa = PBXVariantGroup; 321 | children = ( 322 | 97C147001CF9000F007C117D /* Base */, 323 | ); 324 | name = LaunchScreen.storyboard; 325 | sourceTree = ""; 326 | }; 327 | /* End PBXVariantGroup section */ 328 | 329 | /* Begin XCBuildConfiguration section */ 330 | 97C147031CF9000F007C117D /* Debug */ = { 331 | isa = XCBuildConfiguration; 332 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 333 | buildSettings = { 334 | ALWAYS_SEARCH_USER_PATHS = NO; 335 | CLANG_ANALYZER_NONNULL = YES; 336 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 337 | CLANG_CXX_LIBRARY = "libc++"; 338 | CLANG_ENABLE_MODULES = YES; 339 | CLANG_ENABLE_OBJC_ARC = YES; 340 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 341 | CLANG_WARN_BOOL_CONVERSION = YES; 342 | CLANG_WARN_COMMA = YES; 343 | CLANG_WARN_CONSTANT_CONVERSION = YES; 344 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 345 | CLANG_WARN_EMPTY_BODY = YES; 346 | CLANG_WARN_ENUM_CONVERSION = YES; 347 | CLANG_WARN_INFINITE_RECURSION = YES; 348 | CLANG_WARN_INT_CONVERSION = YES; 349 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 350 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 351 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 352 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 353 | CLANG_WARN_STRICT_PROTOTYPES = YES; 354 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 355 | CLANG_WARN_UNREACHABLE_CODE = YES; 356 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 357 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 358 | COPY_PHASE_STRIP = NO; 359 | DEBUG_INFORMATION_FORMAT = dwarf; 360 | ENABLE_STRICT_OBJC_MSGSEND = YES; 361 | ENABLE_TESTABILITY = YES; 362 | GCC_C_LANGUAGE_STANDARD = gnu99; 363 | GCC_DYNAMIC_NO_PIC = NO; 364 | GCC_NO_COMMON_BLOCKS = YES; 365 | GCC_OPTIMIZATION_LEVEL = 0; 366 | GCC_PREPROCESSOR_DEFINITIONS = ( 367 | "DEBUG=1", 368 | "$(inherited)", 369 | ); 370 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 371 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 372 | GCC_WARN_UNDECLARED_SELECTOR = YES; 373 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 374 | GCC_WARN_UNUSED_FUNCTION = YES; 375 | GCC_WARN_UNUSED_VARIABLE = YES; 376 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 377 | MTL_ENABLE_DEBUG_INFO = YES; 378 | ONLY_ACTIVE_ARCH = YES; 379 | SDKROOT = iphoneos; 380 | TARGETED_DEVICE_FAMILY = "1,2"; 381 | }; 382 | name = Debug; 383 | }; 384 | 97C147041CF9000F007C117D /* Release */ = { 385 | isa = XCBuildConfiguration; 386 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 387 | buildSettings = { 388 | ALWAYS_SEARCH_USER_PATHS = NO; 389 | CLANG_ANALYZER_NONNULL = YES; 390 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 391 | CLANG_CXX_LIBRARY = "libc++"; 392 | CLANG_ENABLE_MODULES = YES; 393 | CLANG_ENABLE_OBJC_ARC = YES; 394 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 395 | CLANG_WARN_BOOL_CONVERSION = YES; 396 | CLANG_WARN_COMMA = YES; 397 | CLANG_WARN_CONSTANT_CONVERSION = YES; 398 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 399 | CLANG_WARN_EMPTY_BODY = YES; 400 | CLANG_WARN_ENUM_CONVERSION = YES; 401 | CLANG_WARN_INFINITE_RECURSION = YES; 402 | CLANG_WARN_INT_CONVERSION = YES; 403 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 404 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 405 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 406 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 407 | CLANG_WARN_STRICT_PROTOTYPES = YES; 408 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 409 | CLANG_WARN_UNREACHABLE_CODE = YES; 410 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 411 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 412 | COPY_PHASE_STRIP = NO; 413 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 414 | ENABLE_NS_ASSERTIONS = NO; 415 | ENABLE_STRICT_OBJC_MSGSEND = YES; 416 | GCC_C_LANGUAGE_STANDARD = gnu99; 417 | GCC_NO_COMMON_BLOCKS = YES; 418 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 419 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 420 | GCC_WARN_UNDECLARED_SELECTOR = YES; 421 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 422 | GCC_WARN_UNUSED_FUNCTION = YES; 423 | GCC_WARN_UNUSED_VARIABLE = YES; 424 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 425 | MTL_ENABLE_DEBUG_INFO = NO; 426 | SDKROOT = iphoneos; 427 | TARGETED_DEVICE_FAMILY = "1,2"; 428 | VALIDATE_PRODUCT = YES; 429 | }; 430 | name = Release; 431 | }; 432 | 97C147061CF9000F007C117D /* Debug */ = { 433 | isa = XCBuildConfiguration; 434 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 435 | buildSettings = { 436 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 437 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 438 | DEVELOPMENT_TEAM = 8JJXUFV6F7; 439 | ENABLE_BITCODE = NO; 440 | FRAMEWORK_SEARCH_PATHS = ( 441 | "$(inherited)", 442 | "$(PROJECT_DIR)/Flutter", 443 | ); 444 | INFOPLIST_FILE = Runner/Info.plist; 445 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 446 | LIBRARY_SEARCH_PATHS = ( 447 | "$(inherited)", 448 | "$(PROJECT_DIR)/Flutter", 449 | ); 450 | PRODUCT_BUNDLE_IDENTIFIER = com.jarvanmo.sonaExample; 451 | PRODUCT_NAME = "$(TARGET_NAME)"; 452 | VERSIONING_SYSTEM = "apple-generic"; 453 | }; 454 | name = Debug; 455 | }; 456 | 97C147071CF9000F007C117D /* Release */ = { 457 | isa = XCBuildConfiguration; 458 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 459 | buildSettings = { 460 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 461 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 462 | DEVELOPMENT_TEAM = 8JJXUFV6F7; 463 | ENABLE_BITCODE = NO; 464 | FRAMEWORK_SEARCH_PATHS = ( 465 | "$(inherited)", 466 | "$(PROJECT_DIR)/Flutter", 467 | ); 468 | INFOPLIST_FILE = Runner/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 470 | LIBRARY_SEARCH_PATHS = ( 471 | "$(inherited)", 472 | "$(PROJECT_DIR)/Flutter", 473 | ); 474 | PRODUCT_BUNDLE_IDENTIFIER = com.jarvanmo.sonaExample; 475 | PRODUCT_NAME = "$(TARGET_NAME)"; 476 | VERSIONING_SYSTEM = "apple-generic"; 477 | }; 478 | name = Release; 479 | }; 480 | /* End XCBuildConfiguration section */ 481 | 482 | /* Begin XCConfigurationList section */ 483 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 97C147031CF9000F007C117D /* Debug */, 487 | 97C147041CF9000F007C117D /* Release */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 493 | isa = XCConfigurationList; 494 | buildConfigurations = ( 495 | 97C147061CF9000F007C117D /* Debug */, 496 | 97C147071CF9000F007C117D /* Release */, 497 | ); 498 | defaultConfigurationIsVisible = 0; 499 | defaultConfigurationName = Release; 500 | }; 501 | /* End XCConfigurationList section */ 502 | }; 503 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 504 | } 505 | -------------------------------------------------------------------------------- /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 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/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 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | sona_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | 8 | 9 | -------------------------------------------------------------------------------- /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 | 4 | import 'package:flutter/services.dart'; 5 | import 'package:sona/sona.dart' as sona; 6 | 7 | void main() => runApp(new MyApp()); 8 | 9 | class MyApp extends StatefulWidget { 10 | @override 11 | _MyAppState createState() => new _MyAppState(); 12 | } 13 | 14 | class _MyAppState extends State { 15 | String _result = 'Unknown'; 16 | 17 | 18 | @override 19 | void initState() { 20 | super.initState(); 21 | sona.register( 22 | appID: "your app id", 23 | appKey: "your app key", 24 | appSecret: "app secret" 25 | ).then((data){ 26 | print(data.runtimeType.toString()); 27 | }); 28 | sona.receivedMessageData.listen(_receiveData,onError: (error){ 29 | print("erro "); 30 | },onDone: (){ 31 | print("done"); 32 | }); 33 | 34 | 35 | 36 | } 37 | 38 | 39 | _receiveData(dynamic data){ 40 | 41 | setState(() { 42 | _result = data.toString(); 43 | }); 44 | } 45 | 46 | @override 47 | Widget build(BuildContext context) { 48 | return new MaterialApp( 49 | home: new Scaffold( 50 | appBar: new AppBar( 51 | title: const Text('Plugin example app'), 52 | ), 53 | body: new Center( 54 | child: new Text('messge: $_result\n'), 55 | ), 56 | ), 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: sona_example 2 | description: Demonstrates how to use the sona plugin. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # Read more about versioning at semver.org. 10 | version: 1.0.0+1 11 | 12 | environment: 13 | sdk: ">=2.0.0-dev.68.0 <3.0.0" 14 | 15 | dependencies: 16 | flutter: 17 | sdk: flutter 18 | 19 | # The following adds the Cupertino Icons font to your application. 20 | # Use with the CupertinoIcons class for iOS style icons. 21 | cupertino_icons: ^0.1.2 22 | 23 | dev_dependencies: 24 | flutter_test: 25 | sdk: flutter 26 | 27 | sona: 28 | path: ../ 29 | 30 | # For information on the generic Dart part of this file, see the 31 | # following page: https://www.dartlang.org/tools/pub/pubspec 32 | 33 | # The following section is specific to Flutter. 34 | flutter: 35 | 36 | # The following line ensures that the Material Icons font is 37 | # included with your application, so that you can use the icons in 38 | # the material Icons class. 39 | uses-material-design: true 40 | 41 | # To add assets to your application, add an assets section, like this: 42 | # assets: 43 | # - images/a_dot_burr.jpeg 44 | # - images/a_dot_ham.jpeg 45 | 46 | # An image asset can refer to one or more resolution-specific "variants", see 47 | # https://flutter.io/assets-and-images/#resolution-aware. 48 | 49 | # For details regarding adding assets from package dependencies, see 50 | # https://flutter.io/assets-and-images/#from-packages 51 | 52 | # To add custom fonts to your application, add a fonts section here, 53 | # in this "flutter" section. Each entry in this list should have a 54 | # "family" key with the font family name, and a "fonts" key with a 55 | # list giving the asset and other descriptors for the font. For 56 | # example: 57 | # fonts: 58 | # - family: Schyler 59 | # fonts: 60 | # - asset: fonts/Schyler-Regular.ttf 61 | # - asset: fonts/Schyler-Italic.ttf 62 | # style: italic 63 | # - family: Trajan Pro 64 | # fonts: 65 | # - asset: fonts/TrajanPro.ttf 66 | # - asset: fonts/TrajanPro_Bold.ttf 67 | # weight: 700 68 | # 69 | # For details regarding fonts from package dependencies, 70 | # see https://flutter.io/custom-fonts/#from-packages 71 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter 3 | // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to 4 | // find child widgets in the widget tree, read text, and verify that the values of widget properties 5 | // are correct. 6 | 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter_test/flutter_test.dart'; 9 | 10 | import 'package:sona_example/main.dart'; 11 | 12 | void main() { 13 | testWidgets('Verify Platform version', (WidgetTester tester) async { 14 | // Build our app and trigger a frame. 15 | await tester.pumpWidget(new MyApp()); 16 | 17 | // Verify that platform version is retrieved. 18 | expect( 19 | find.byWidgetPredicate( 20 | (Widget widget) => 21 | widget is Text && widget.data.startsWith('Running on:'), 22 | ), 23 | findsOneWidget); 24 | }); 25 | } 26 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenFlutter/sona/befd0d68afc4f013a3cb5a4dc9bc582db7a6db34/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/SonaPlugin.m: -------------------------------------------------------------------------------- 1 | #import "SonaPlugin.h" 2 | #import "SonaStringUtil.h" 3 | 4 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 5 | 6 | #import 7 | 8 | #endif 9 | 10 | @implementation SonaPlugin 11 | + (void)registerWithRegistrar:(NSObject *)registrar { 12 | FlutterMethodChannel *channel = [FlutterMethodChannel 13 | methodChannelWithName:@"com.jarvanmo/sona" 14 | binaryMessenger:[registrar messenger]]; 15 | SonaPlugin *instance = [SonaPlugin sonaPlugin]; 16 | [instance setMethodChannel:channel]; 17 | [registrar addMethodCallDelegate:instance channel:channel]; 18 | [registrar addApplicationDelegate:instance]; 19 | } 20 | 21 | FlutterMethodChannel *sonMethodChannel; 22 | 23 | BOOL isRgisterGetuiBySona = YES; 24 | const NSString *keyAlias = @"alias"; 25 | 26 | + (BOOL)registerGetuiPushBySona { 27 | return isRgisterGetuiBySona; 28 | } 29 | 30 | + (void)setRegisterGetuiPushBySona:(BOOL)registerGetuiPushBySona { 31 | isRgisterGetuiBySona = registerGetuiPushBySona; 32 | } 33 | 34 | #pragma mark - LifeCycle 35 | 36 | + (instancetype)sonaPlugin { 37 | static dispatch_once_t onceToken; 38 | static SonaPlugin *instance; 39 | dispatch_once(&onceToken, ^{ 40 | instance = [[SonaPlugin alloc] init]; 41 | 42 | }); 43 | return instance; 44 | } 45 | 46 | - (void)setMethodChannel:(FlutterMethodChannel *)channel { 47 | sonMethodChannel = channel; 48 | } 49 | 50 | - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { 51 | if ([@"registerGeTui" isEqualToString:call.method]) { 52 | [self registerGetui:call result:result]; 53 | } else if ([@"turnOnPush" isEqualToString:call.method]) { 54 | [self turnOnPush:call result:result]; 55 | } else if ([@"bindAlias" isEqualToString:call.method]) { 56 | [self bindAlias:call result:result]; 57 | } else if ([@"unBindAlias" isEqualToString:call.method]) { 58 | [self unBindAlias:call result:result]; 59 | } else if([@"clientID" isEqualToString:call.method]){ 60 | [self getClientID:result]; 61 | } else if([@"setBadge" isEqualToString:call.method]){ 62 | [self setBadge:call result:result]; 63 | } else{ 64 | result(FlutterMethodNotImplemented); 65 | } 66 | } 67 | 68 | - (void)setBadge:(FlutterMethodCall *)call result:(FlutterResult)result { 69 | NSUInteger value = [call.arguments unsignedIntegerValue]; 70 | 71 | [GeTuiSdk setBadge:value]; 72 | [[UIApplication sharedApplication] setApplicationIconBadgeNumber:value]; 73 | 74 | result(@YES); 75 | } 76 | 77 | - (void)bindAlias:(FlutterMethodCall *)call result:(FlutterResult)result { 78 | NSString *aliasFromSona = call.arguments[keyAlias]; 79 | 80 | 81 | NSString *sn = call.arguments[@"sequenceNum"]; 82 | 83 | if ([SonaStringUtil isBlank:sn]) { 84 | NSDate *currentDate = [NSDate date]; 85 | NSTimeInterval time = [currentDate timeIntervalSince1970] * 1000;// *1000 是精确到毫秒,不乘就是精确到秒 86 | NSString *timeString = [NSString stringWithFormat:@"bindAlias_%.0f", time]; 87 | sn = timeString; 88 | } 89 | 90 | [GeTuiSdk bindAlias:aliasFromSona andSequenceNum:sn]; 91 | 92 | result(@YES); 93 | } 94 | 95 | - (void)unBindAlias:(FlutterMethodCall *)call result:(FlutterResult)result { 96 | NSString *aliasFromSona = call.arguments[keyAlias]; 97 | 98 | 99 | NSString *sn = call.arguments[@"sequenceNum"]; 100 | 101 | if ([SonaStringUtil isBlank:sn]) { 102 | NSDate *currentDate = [NSDate date]; 103 | NSTimeInterval time = [currentDate timeIntervalSince1970] * 1000; 104 | NSString *timeString = [NSString stringWithFormat:@"bindAlias_%.0f", time]; 105 | sn = timeString; 106 | } 107 | 108 | BOOL isSelf = [call.arguments[@"isSelf"] boolValue]; 109 | [GeTuiSdk unbindAlias:aliasFromSona andSequenceNum:sn andIsSelf:isSelf]; 110 | 111 | result(@YES); 112 | } 113 | 114 | - (void)turnOnPush:(FlutterMethodCall *)call result:(FlutterResult)result { 115 | BOOL isOn = [call.arguments boolValue]; 116 | [GeTuiSdk setPushModeForOff:!isOn]; 117 | result(@YES); 118 | } 119 | 120 | - (void)registerGetui:(FlutterMethodCall *)call result:(FlutterResult)result { 121 | BOOL registerOnIOS = [call.arguments[@"registerOnIOS"] boolValue]; 122 | 123 | if (!registerOnIOS) { 124 | result(@{ 125 | @"platform": @"iOS", 126 | @"result": @YES 127 | }); 128 | return; 129 | } 130 | 131 | NSString *kGtAppId = call.arguments[@"appID"]; 132 | NSString *kGtAppKey = call.arguments[@"appKey"]; 133 | NSString *kGtAppSecret = call.arguments[@"appSecret"]; 134 | if ([SonaStringUtil isBlank:kGtAppId] || [SonaStringUtil isBlank:kGtAppKey] || [SonaStringUtil isBlank:kGtAppSecret]) { 135 | result([FlutterError errorWithCode:@"invalid appID,appKey,or appSecret" 136 | message:@"these params can't be blank,have a check please!" 137 | details:[NSString stringWithFormat:@"appID=%@,appKey=%@,appSecret=%@", kGtAppId, kGtAppKey, kGtAppSecret]]); 138 | return; 139 | } 140 | 141 | NSString *channel = call.arguments[@"channel"]; 142 | if (![SonaStringUtil isBlank:channel]) { 143 | [GeTuiSdk setChannelId:channel]; 144 | } 145 | 146 | BOOL lbsLocationEnable = [call.arguments[@""] boolValue]; 147 | BOOL userVerify = [call.arguments[@"userVerify"] boolValue]; 148 | [GeTuiSdk lbsLocationEnable:lbsLocationEnable andUserVerify:userVerify]; 149 | 150 | 151 | [GeTuiSdk startSdkWithAppId:kGtAppId appKey:kGtAppKey appSecret:kGtAppSecret delegate:self]; 152 | 153 | [GeTuiSdk setPushModeForOff:NO]; 154 | // 注册APNs - custom method - 开发者自定义的方法 155 | [self registerRemoteNotification]; 156 | 157 | // 注册VOIP 158 | [self voipRegistration]; 159 | } 160 | 161 | -(void) getClientID:(FlutterResult)result { 162 | result([GeTuiSdk clientId]); 163 | } 164 | 165 | #pragma mark - 用户通知(推送) _自定义方法 166 | 167 | /** 注册远程通知 */ 168 | - (void)registerRemoteNotification { 169 | /* 170 | 警告:Xcode8的需要手动开启“TARGETS -> Capabilities -> Push Notifications” 171 | */ 172 | 173 | /* 174 | 警告:该方法需要开发者自定义,以下代码根据APP支持的iOS系统不同,代码可以对应修改。 175 | 以下为演示代码,注意根据实际需要修改,注意测试支持的iOS系统都能获取到DeviceToken 176 | */ 177 | if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) { 178 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 // Xcode 8编译会调用 179 | UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; 180 | center.delegate = self; 181 | [center requestAuthorizationWithOptions:(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionCarPlay) completionHandler:^(BOOL granted, NSError *_Nullable error) { 182 | if (!error) { 183 | NSLog(@"request authorization succeeded!"); 184 | } 185 | }]; 186 | 187 | [[UIApplication sharedApplication] registerForRemoteNotifications]; 188 | #else // Xcode 7编译会调用 189 | UIUserNotificationType types = (UIUserNotificationTypeAlert | UIUserNotificationTypeSound | UIUserNotificationTypeBadge); 190 | UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; 191 | [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; 192 | [[UIApplication sharedApplication] registerForRemoteNotifications]; 193 | #endif 194 | } else if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { 195 | UIUserNotificationType types = (UIUserNotificationTypeAlert | UIUserNotificationTypeSound | UIUserNotificationTypeBadge); 196 | UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; 197 | [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; 198 | [[UIApplication sharedApplication] registerForRemoteNotifications]; 199 | } else { 200 | UIRemoteNotificationType apn_type = (UIRemoteNotificationType) (UIRemoteNotificationTypeAlert | 201 | UIRemoteNotificationTypeSound | 202 | UIRemoteNotificationTypeBadge); 203 | [[UIApplication sharedApplication] registerForRemoteNotificationTypes:apn_type]; 204 | } 205 | } 206 | 207 | #pragma mark - 远程通知(推送)回调 208 | 209 | /** 远程通知注册成功委托 */ 210 | - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { 211 | NSString *token = [[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]]; 212 | token = [token stringByReplacingOccurrencesOfString:@" " withString:@""]; 213 | NSLog(@"\n>>>[DeviceToken Success]:%@\n\n", token); 214 | 215 | // [ GTSdk ]:向个推服务器注册deviceToken 216 | [GeTuiSdk registerDeviceToken:token]; 217 | } 218 | 219 | /** 远程通知注册失败委托 */ 220 | - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { 221 | NSLog(@"\n>>>[DeviceToken Error]:%@\n\n", error.description); 222 | } 223 | 224 | #pragma mark - APP运行中接收到通知(推送)处理 - iOS 10以下版本收到推送 225 | 226 | /** APP已经接收到“远程”通知(推送) - 透传推送消息 */ 227 | - (BOOL)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { 228 | 229 | // [ GTSdk ]:将收到的APNs信息传给个推统计 230 | [GeTuiSdk handleRemoteNotification:userInfo]; 231 | 232 | // 控制台打印接收APNs信息 233 | NSLog(@"\n>>>[Receive RemoteNotification]:%@\n\n", userInfo); 234 | 235 | completionHandler(UIBackgroundFetchResultNewData); 236 | 237 | return YES; 238 | } 239 | 240 | #pragma mark - iOS 10中收到推送消息 241 | 242 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 243 | 244 | // iOS 10: App在前台获取到通知 245 | - (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler { 246 | 247 | NSLog(@"willPresentNotification:%@", notification.request.content.userInfo); 248 | 249 | // 根据APP需要,判断是否要提示用户Badge、Sound、Alert 250 | completionHandler(UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert); 251 | } 252 | 253 | // iOS 10: 点击通知进入App时触发 254 | - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler { 255 | 256 | NSLog(@"didReceiveNotification:%@", response.notification.request.content.userInfo); 257 | 258 | // [ GTSdk ]:将收到的APNs信息传给个推统计 259 | [GeTuiSdk handleRemoteNotification:response.notification.request.content.userInfo]; 260 | 261 | completionHandler(); 262 | } 263 | 264 | #endif 265 | 266 | #pragma mark - VOIP 接入 267 | 268 | /** 注册VOIP服务 */ 269 | - (void)voipRegistration { 270 | dispatch_queue_t mainQueue = dispatch_get_main_queue(); 271 | PKPushRegistry *voipRegistry = [[PKPushRegistry alloc] initWithQueue:mainQueue]; 272 | voipRegistry.delegate = self; 273 | // Set the push type to VoIP 274 | voipRegistry.desiredPushTypes = [NSSet setWithObject:PKPushTypeVoIP]; 275 | } 276 | 277 | // 实现 PKPushRegistryDelegate 协议方法 278 | 279 | /** 系统返回VOIPToken,并提交个推服务器 */ 280 | - (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type { 281 | NSString *voiptoken = [credentials.token.description stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]]; 282 | voiptoken = [voiptoken stringByReplacingOccurrencesOfString:@" " withString:@""]; 283 | 284 | //向个推服务器注册 VoipToken 285 | [GeTuiSdk registerVoipToken:voiptoken]; 286 | } 287 | 288 | /** 接收VOIP推送中的payload进行业务逻辑处理(一般在这里调起本地通知实现连续响铃、接收视频呼叫请求等操作),并执行个推VOIP回执统计 */ 289 | - (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type { 290 | //个推VOIP回执统计 291 | [GeTuiSdk handleVoipNotification:payload.dictionaryPayload]; 292 | 293 | //TODO:接受VOIP推送中的payload内容进行具体业务逻辑处理 294 | NSLog(@"[Voip Payload]:%@,%@", payload, payload.dictionaryPayload); 295 | } 296 | 297 | 298 | #pragma mark - GeTuiSdkDelegate 299 | 300 | /** SDK启动成功返回cid */ 301 | - (void)GeTuiSdkDidRegisterClient:(NSString *)clientId { 302 | // [4-EXT-1]: 个推SDK已注册,返回clientId 303 | NSLog(@"\n>>[GTSdk RegisterClient]:%@\n\n", clientId); 304 | } 305 | 306 | /** SDK遇到错误回调 */ 307 | - (void)GeTuiSdkDidOccurError:(NSError *)error { 308 | // [EXT]:个推错误报告,集成步骤发生的任何错误都在这里通知,如果集成后,无法正常收到消息,查看这里的通知。 309 | NSLog(@"\n>>[GTSdk error]:%@\n\n", [error localizedDescription]); 310 | } 311 | 312 | 313 | /** SDK收到透传消息回调 */ 314 | - (void)GeTuiSdkDidReceivePayloadData:(NSData *)payloadData andTaskId:(NSString *)taskId andMsgId:(NSString *)msgId andOffLine:(BOOL)offLine fromGtAppId:(NSString *)appId { 315 | // [ GTSdk ]:汇报个推自定义事件(反馈透传消息) 316 | // [GeTuiSdk sendFeedbackMessage:90001 andTaskId:taskId andMsgId:msgId]; 317 | 318 | NSDictionary *commonResult = @{ 319 | @"appID": appId, 320 | @"taskID": taskId, 321 | @"messageID": msgId, 322 | @"offLine": @(offLine), 323 | 324 | }; 325 | 326 | 327 | NSMutableDictionary *result = [NSMutableDictionary dictionaryWithDictionary:commonResult]; 328 | // 数据转换 329 | NSString *payloadMsg = nil; 330 | if (payloadData) { 331 | payloadMsg = [[NSString alloc] initWithBytes:payloadData.bytes length:payloadData.length encoding:NSUTF8StringEncoding]; 332 | result[@"payload"] = payloadMsg; 333 | } 334 | 335 | [sonMethodChannel invokeMethod:@"onReceiveMessageData" arguments:result]; 336 | } 337 | 338 | /** SDK收到sendMessage消息回调 */ 339 | - (void)GeTuiSdkDidSendMessage:(NSString *)messageId result:(int)result { 340 | // 发送上行消息结果反馈 341 | NSString *msg = [NSString stringWithFormat:@"sendmessage=%@,result=%d", messageId, result]; 342 | NSLog(@"\n>>[GTSdk DidSendMessage]:%@\n\n", msg); 343 | } 344 | 345 | /** SDK运行状态通知 */ 346 | - (void)GeTuiSDkDidNotifySdkState:(SdkStatus)aStatus { 347 | // 通知SDK运行状态 348 | NSLog(@"\n>>[GTSdk SdkState]:%u\n\n", aStatus); 349 | 350 | NSString *argument = @"STARTED"; 351 | if (aStatus == SdkStatusStarting) { 352 | argument = @"STARTING"; 353 | } else if (aStatus == SdkStatusOffline) { 354 | argument = @"OFFLINE"; 355 | } else if (aStatus == SdkStatusStoped) { 356 | argument = @"STOPPED"; 357 | } 358 | 359 | [sonMethodChannel invokeMethod:@"onReceiveOnlineState" arguments:argument]; 360 | 361 | 362 | } 363 | 364 | /** SDK设置推送模式回调 */ 365 | - (void)GeTuiSdkDidSetPushMode:(BOOL)isModeOff error:(NSError *)error { 366 | if (error) { 367 | NSLog(@"\n>>[GTSdk SetModeOff Error]:%@\n\n", [error localizedDescription]); 368 | return; 369 | } 370 | 371 | NSLog(@"\n>>[GTSdk SetModeOff]:%@\n\n", isModeOff ? @"开启" : @"关闭"); 372 | } 373 | 374 | @end 375 | -------------------------------------------------------------------------------- /ios/Classes/handler/RegisterHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by mo on 2018/9/11. 3 | // 4 | 5 | #import 6 | #import 7 | 8 | 9 | 10 | @interface RegisterHandler : NSObject 11 | -(void) registerGetui:(FlutterMethodCall*)call result:(FlutterResult)result; 12 | @end -------------------------------------------------------------------------------- /ios/Classes/handler/RegisterHandler.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by mo on 2018/9/11. 3 | // 4 | 5 | #import "RegisterHandler.h" 6 | 7 | 8 | @implementation RegisterHandler 9 | 10 | - (void)registerGetui:(FlutterMethodCall *)call result:(FlutterResult)result { 11 | BOOL registerOnIOS= [call.arguments[@"registerOnIOS"] boolValue]; 12 | 13 | if(!registerOnIOS){ 14 | return; 15 | } 16 | 17 | } 18 | @end -------------------------------------------------------------------------------- /ios/Classes/helper/SonaStringUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by mo on 2018/8/15. 3 | // 4 | 5 | #import 6 | 7 | 8 | @interface SonaStringUtil : NSObject 9 | + (BOOL) isBlank:(NSString *)string; 10 | + (NSString *) nilToEmpty:(NSString *) string; 11 | @end -------------------------------------------------------------------------------- /ios/Classes/helper/SonaStringUtil.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by mo on 2018/8/15. 3 | // 4 | 5 | #import "SonaStringUtil.h" 6 | 7 | 8 | @implementation SonaStringUtil 9 | 10 | + (BOOL) isBlank:(NSString *)string { 11 | 12 | if (string == nil) { 13 | 14 | return YES; 15 | 16 | } 17 | 18 | 19 | if ([string isKindOfClass:[NSNull class]]) { 20 | 21 | return YES; 22 | 23 | } 24 | return [[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length] == 0; 25 | 26 | } 27 | 28 | + (NSString *)nilToEmpty:(NSString *)string { 29 | return string == nil?@"":string; 30 | } 31 | @end -------------------------------------------------------------------------------- /ios/Classes/public/SonaPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "GTSDK/GeTuiSdk.h" 3 | #import 4 | #import 5 | 6 | 7 | @interface SonaPlugin : UIResponder 8 | + (instancetype) sonaPlugin; 9 | @end 10 | -------------------------------------------------------------------------------- /ios/sona.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 = 'sona' 6 | s.version = '0.0.1' 7 | s.summary = 'sona makes possible using umeng push in flutter.' 8 | s.description = <<-DESC 9 | sona makes possible using umeng push in flutter. 10 | DESC 11 | s.homepage = 'http://example.com' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'Your Company' => 'email@example.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = 'Classes/public/*.h' 17 | s.static_framework = true 18 | s.dependency 'Flutter' 19 | s.dependency 'GTSDK' 20 | 21 | 22 | s.ios.deployment_target = '8.0' 23 | end 24 | 25 | -------------------------------------------------------------------------------- /lib/sona.dart: -------------------------------------------------------------------------------- 1 | library sona; 2 | 3 | export 'src/sona_iml.dart'; 4 | export 'src/sdk_status.dart'; 5 | export 'src/son_data_model.dart'; -------------------------------------------------------------------------------- /lib/src/sdk_status.dart: -------------------------------------------------------------------------------- 1 | ///Android only has two kind of status:[GTSdkStatus.STARTED] and [GTSdkStatus.OFFLINE] 2 | ///Read official documents for more details. 3 | enum GTSdkStatus { 4 | STARTING, // 正在启动 5 | STARTED, // 启动、在线 6 | STOPPED, // 停止 7 | OFFLINE, // 离线 8 | } 9 | -------------------------------------------------------------------------------- /lib/src/son_data_model.dart: -------------------------------------------------------------------------------- 1 | /// This only works on Android. 2 | class NotificationMessageModel { 3 | final String platform; 4 | final String appID; 5 | final String messageID; 6 | final String taskID; 7 | final String pkgName; 8 | final String clientID; 9 | final String content; 10 | final String title; 11 | 12 | NotificationMessageModel({this.platform, this.appID, this.messageID, 13 | this.taskID, this.pkgName, this.clientID, this.content, this.title}); 14 | } 15 | 16 | 17 | ///[appID],[appKey] and [appSecret] only works on iOS because 18 | ///you have to configure these params in your build.gradle file on Android. 19 | /// sona will register push-manager if [registerOnAndroid] or [registerOnIOS] is true 20 | ///[pushServiceName] only works on Android .GeTui allows you 21 | /// use custom push service to ensure GeTui works well on some devices.[pushServiceName] is a full name of your 22 | /// push service in JAVA.[pushServiceName] is not necessary.For details ,see [details](http://docs.getui.com/getui/mobile/android/androidstudio_maven/) 23 | /// [channel] only works on iOS 24 | class _RegisterGetuiPushModel { 25 | final String appID; 26 | final String appKey; 27 | final String appSecret; 28 | final bool registerOnAndroid; 29 | final bool registerOnIOS; 30 | final String channel; 31 | 32 | final String pushServiceName; 33 | 34 | bool lbsLocationEnable; 35 | bool userVerify; 36 | 37 | _RegisterGetuiPushModel( 38 | {this.appID, 39 | this.appKey, 40 | this.appSecret, 41 | this.registerOnAndroid: true, 42 | this.registerOnIOS: true, 43 | this.channel, 44 | this.pushServiceName, 45 | this.lbsLocationEnable: false, 46 | this.userVerify: false}); 47 | 48 | get params => _mapInternal(); 49 | 50 | Map _mapInternal() { 51 | return { 52 | "appID": appID, 53 | "appKey": appKey, 54 | "appSecret": appSecret, 55 | "registerOnAndroid": registerOnAndroid, 56 | "registerOnIOS": registerOnIOS, 57 | "channel": channel, 58 | "pushServiceName": pushServiceName, 59 | "lbsLocationEnable": lbsLocationEnable, 60 | "userVerify": userVerify 61 | }; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/src/sona_iml.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/services.dart'; 4 | 5 | import 'sdk_status.dart'; 6 | import 'son_data_model.dart'; 7 | 8 | final MethodChannel _channel = const MethodChannel('com.jarvanmo/sona') 9 | ..setMethodCallHandler(_handler); 10 | 11 | ///[appID],[appKey] and [appSecret] only works on iOS because 12 | ///you have to configure these params in your build.gradle file on Android. 13 | /// sona will register push-manager if [registerOnAndroid] or [registerOnIOS] is true 14 | ///[pushServiceName] only works on Android .GeTui allows you 15 | /// use custom push service to ensure GeTui works well on some devices.[pushServiceName] is a full name of your 16 | /// push service in JAVA.[pushServiceName] is not necessary.For details ,see [details](http://docs.getui.com/getui/mobile/android/androidstudio_maven/) 17 | /// [channel] only works on iOS 18 | Future> register( 19 | {String appID, 20 | String appKey, 21 | String appSecret, 22 | bool registerOnAndroid: true, 23 | bool registerOnIOS: true, 24 | String channel, 25 | String pushServiceName, 26 | bool lbsLocationEnable: false, 27 | bool userVerify: false}) async { 28 | return await _channel.invokeMethod("registerGeTui", { 29 | "appID": appID, 30 | "appKey": appKey, 31 | "appSecret": appSecret, 32 | "registerOnAndroid": registerOnAndroid, 33 | "registerOnIOS": registerOnIOS, 34 | "channel": channel, 35 | "pushServiceName": pushServiceName, 36 | "lbsLocationEnable": lbsLocationEnable, 37 | "userVerify": userVerify 38 | }); 39 | } 40 | 41 | Future setBadge(int count) async { 42 | if(count<0) count = 0; 43 | await _channel.invokeMethod("setBadge",count); 44 | } 45 | 46 | Future clientID() async { 47 | return await _channel.invokeMethod("clientID"); 48 | } 49 | 50 | Future turnOnPush({bool isOn: true}) async { 51 | return await _channel.invokeMethod("turnOnPush", isOn); 52 | } 53 | 54 | Future bindAlias(String alias, {String sequenceNum}) async { 55 | if (alias == null) { 56 | throw Exception("alias can't be null"); 57 | } 58 | return await _channel 59 | .invokeMethod("bindAlias", {"alias": alias, "sequenceNum": sequenceNum}); 60 | } 61 | 62 | Future unBindAlias(String alias, {String sn, bool isSelf}) async { 63 | if (alias == null) { 64 | throw Exception("alias can't be null"); 65 | } 66 | return await _channel.invokeMethod( 67 | "unBindAlias", {"alias": alias, "sn": sn, "isSelf": isSelf}); 68 | } 69 | 70 | StreamController _receivedClientIDController = 71 | new StreamController.broadcast(); 72 | 73 | Stream get receivedClientID => _receivedClientIDController.stream; 74 | 75 | final StreamController> _receivedMessageDataController = 76 | new StreamController.broadcast(); 77 | 78 | ///// listen data from getui 79 | Stream> get receivedMessageData => 80 | _receivedMessageDataController.stream; 81 | 82 | StreamController _receivedSdkStatusController = 83 | new StreamController.broadcast(); 84 | 85 | Stream get receivedSdkStatus => 86 | _receivedSdkStatusController.stream; 87 | 88 | StreamController 89 | _onNotificationMessageClickedController = new StreamController.broadcast(); 90 | 91 | Stream get onNotificationMessageClicked => 92 | _onNotificationMessageClickedController.stream; 93 | 94 | StreamController 95 | _onNotificationMessageArrivedController = new StreamController.broadcast(); 96 | 97 | Stream get onNotificationMessageArrived => 98 | _onNotificationMessageArrivedController.stream; 99 | 100 | dispose() { 101 | _receivedClientIDController.close(); 102 | _receivedMessageDataController.close(); 103 | _receivedSdkStatusController.close(); 104 | _onNotificationMessageClickedController.close(); 105 | _onNotificationMessageArrivedController.close(); 106 | } 107 | 108 | Future _handler(MethodCall methodCall) { 109 | if ("onReceiveMessageData" == methodCall.method) { 110 | _receivedMessageDataController.add(methodCall.arguments); 111 | } else if ("onReceiveClientId" == methodCall.method) { 112 | _receivedClientIDController.add(methodCall.arguments); 113 | } else if ("onReceiveOnlineState" == methodCall.arguments) { 114 | _handleSdkStatus(methodCall); 115 | } else if ("onNotificationMessageClicked" == methodCall.arguments) { 116 | _handleOnNotificationMessageClicked(methodCall); 117 | }else if("onNotificationMessageArrived" == methodCall.arguments){ 118 | _handleOnNotificationMessageArrived(methodCall); 119 | } 120 | 121 | return Future.value(true); 122 | } 123 | 124 | _handleSdkStatus(MethodCall methodCall) { 125 | if ("STARTING" == methodCall.arguments) { 126 | _receivedSdkStatusController.add(GTSdkStatus.STARTING); 127 | } else if ("STARTED" == methodCall.arguments) { 128 | _receivedSdkStatusController.add(GTSdkStatus.STARTED); 129 | } else if ("OFFLINE" == methodCall.arguments) { 130 | _receivedSdkStatusController.add(GTSdkStatus.OFFLINE); 131 | } else if ("STOPPED" == methodCall.arguments) { 132 | _receivedSdkStatusController.add(GTSdkStatus.STOPPED); 133 | } 134 | } 135 | 136 | _handleOnNotificationMessageClicked(MethodCall methodCall) { 137 | _onNotificationMessageClickedController.add(NotificationMessageModel( 138 | platform: methodCall.arguments["platform"], 139 | appID: methodCall.arguments["appID"], 140 | taskID: methodCall.arguments["taskID"], 141 | messageID: methodCall.arguments["messageID"], 142 | pkgName: methodCall.arguments["pkgName"], 143 | content: methodCall.arguments["content"], 144 | title: methodCall.arguments["title"])); 145 | } 146 | 147 | _handleOnNotificationMessageArrived(MethodCall methodCall) { 148 | _onNotificationMessageArrivedController.add(NotificationMessageModel( 149 | platform: methodCall.arguments["platform"], 150 | appID: methodCall.arguments["appID"], 151 | taskID: methodCall.arguments["taskID"], 152 | messageID: methodCall.arguments["messageID"], 153 | pkgName: methodCall.arguments["pkgName"], 154 | content: methodCall.arguments["content"], 155 | title: methodCall.arguments["title"])); 156 | } 157 | 158 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: sona 2 | description: Sona makes possible using Getui push in flutter.Sona can handle payload data and etc. 3 | version: 0.0.9+2 4 | author: JarvanMo 5 | homepage: https://github.com/JarvanMo/sona 6 | 7 | environment: 8 | sdk: ">=2.0.0-dev.68.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | # For information on the generic Dart part of this file, see the 15 | # following page: https://www.dartlang.org/tools/pub/pubspec 16 | 17 | # The following section is specific to Flutter. 18 | flutter: 19 | plugin: 20 | androidPackage: com.jarvanmo.sona 21 | pluginClass: SonaPlugin 22 | 23 | # To add assets to your plugin package, add an assets section, like this: 24 | # assets: 25 | # - images/a_dot_burr.jpeg 26 | # - images/a_dot_ham.jpeg 27 | # 28 | # For details regarding assets in packages, see 29 | # https://flutter.io/assets-and-images/#from-packages 30 | # 31 | # An image asset can refer to one or more resolution-specific "variants", see 32 | # https://flutter.io/assets-and-images/#resolution-aware. 33 | 34 | # To add custom fonts to your plugin package, add a fonts section here, 35 | # in this "flutter" section. Each entry in this list should have a 36 | # "family" key with the font family name, and a "fonts" key with a 37 | # list giving the asset and other descriptors for the font. For 38 | # example: 39 | # fonts: 40 | # - family: Schyler 41 | # fonts: 42 | # - asset: fonts/Schyler-Regular.ttf 43 | # - asset: fonts/Schyler-Italic.ttf 44 | # style: italic 45 | # - family: Trajan Pro 46 | # fonts: 47 | # - asset: fonts/TrajanPro.ttf 48 | # - asset: fonts/TrajanPro_Bold.ttf 49 | # weight: 700 50 | # 51 | # For details regarding fonts in packages, see 52 | # https://flutter.io/custom-fonts/#from-packages 53 | --------------------------------------------------------------------------------