Merge pull request #1 from AppleEducate/native_plugin

Native plugin
This commit is contained in:
Rody Davis 2018-08-16 09:58:52 -04:00 committed by GitHub
commit 7c2eff034f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
96 changed files with 532 additions and 14105 deletions

7
.vscode/launch.json vendored
View File

@ -1,7 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": []
}

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "automatic"
}

View File

@ -1,10 +1,64 @@
# flutter_sms
A Flutter plugin for Sending SMS on Android and iOS.
![alt text](repo/blob/master/screenshots/ios_blank.PNG)
## Getting Started
## Description
For help getting started with Flutter, view our online
[documentation](https://flutter.io/).
Flutter Plugin for sending SMS and MMS on Android and iOS. If you send to more than one person it will send as MMS. On the iOS if the number is an iPhone and iMessage is enabled it will send as an iMessage.
For help on editing plugin code, view the [documentation](https://flutter.io/developing-packages/#edit-plugin-package).
## How To Use
You can send multiple ways:
1. Message and No People
2. People and No Message
3. Message and People
This will prefil the correct fields.
## Setup
### Android
Add this to your AndroidManifest.xml
``` xml
<uses-permission android:name="android.permission.SEND_SMS"/>
```
### iOS
Good to go!
## Example
Make sure to Install and Import the Package.
``` dart
import 'package:flutter_sms/flutter_sms.dart';
```
Create a function for sending messages.
``` dart
String _message = "";
void _sendSMS(String message, List<String> recipents) async {
String _result =
await FlutterSms.sendSMS(message: message, recipients: recipents);
setState(() => _message = _result);
}
```
You can quickly send the message with this function.
``` dart
_sendSMS("Here is a test Message", ["5555543454", "78467477788"])
```
## Screenshots
![alt text](repo/blob/master/screenshots/ios_sms.PNG)
![alt text](repo/blob/master/screenshots/android_mms.png)
You can find other [screenshots here](repo/blob/screenshots).

6
android/.classpath Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>

1
android/.idea/.name Normal file
View File

@ -0,0 +1 @@
flutter_sms

Binary file not shown.

View File

@ -0,0 +1,29 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="h" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
</code_scheme>
</component>

17
android/.idea/gradle.xml Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

31
android/.idea/misc.xml Normal file
View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="5">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/flutter_sms.iml" filepath="$PROJECT_DIR$/flutter_sms.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>

23
android/.project Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>flutter_sms</name>
<comment>Project flutter_sms created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,2 @@
connection.project.dir=
eclipse.preferences.version=1

View File

@ -58,4 +58,5 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:support-v4:27.1.0'
}

View File

@ -32,3 +32,7 @@ android {
disable 'InvalidPackage'
}
}
dependencies {
api 'com.android.support:appcompat-v7:27.1.0'
}

View File

@ -5,21 +5,112 @@ import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry.Registrar;
import android.app.Activity;
import android.content.Intent;
import android.telephony.SmsManager;
import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.provider.Settings;
import android.support.v4.app.ActivityCompat;
//import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.provider.MediaStore;
import android.support.annotation.VisibleForTesting;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.FileProvider;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.PluginRegistry;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.UUID;
import java.util.ArrayList;
/** FlutterSmsPlugin */
public class FlutterSmsPlugin implements MethodCallHandler {
Activity activity;
/** Plugin registration. */
public static void registerWith(Registrar registrar) {
final MethodChannel channel = new MethodChannel(registrar.messenger(), "flutter_sms");
channel.setMethodCallHandler(new FlutterSmsPlugin());
channel.setMethodCallHandler(new FlutterSmsPlugin(registrar.activity()));
}
@Override
public void onMethodCall(MethodCall call, Result result) {
if (call.method.equals("getPlatformVersion")) {
result.success("Android " + android.os.Build.VERSION.RELEASE);
if (call.method.equals("sendSMS")) {
String message = call.argument("message");
ArrayList<String> recipients = call.argument("recipients");
String smsPermission = "SEND_SMS";
if (!checkPermission(smsPermission)) {
requestPermission(smsPermission);
if (!checkPermission(smsPermission)) {
openSettings();
} else {
sendSMS(recipients, message);
}
} else {
sendSMS(recipients, message);
}
result.success("Sent!");
} else {
result.notImplemented();
}
}
private FlutterSmsPlugin(Activity activity) {
this.activity = activity;
}
private void sendSMS(ArrayList<String> phones, String message) {
Intent sendIntent = new Intent(Intent.ACTION_VIEW);
sendIntent.putExtra("sms_body", message);
sendIntent.setData(Uri.parse("sms:" + phones));
activity.startActivity(sendIntent);
}
private boolean checkPermission(String permission) {
permission = getManifestPermission(permission);
Log.i("SimplePermission", "Checking permission : " + permission);
return PackageManager.PERMISSION_GRANTED == ActivityCompat.checkSelfPermission(activity, permission);
}
private void requestPermission(String permission) {
permission = getManifestPermission(permission);
Log.i("SimplePermission", "Requesting permission : " + permission);
String[] perm = { permission };
ActivityCompat.requestPermissions(activity, perm, 0);
}
private String getManifestPermission(String permission) {
String res;
switch (permission) {
case "SEND_SMS":
res = Manifest.permission.SEND_SMS;
break;
default:
res = "ERROR";
break;
}
return res;
}
private void openSettings() {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.parse("package:" + activity.getPackageName()));
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
activity.startActivity(intent);
}
}

17
example/android/.project Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>android</name>
<comment>Project android created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,2 @@
connection.project.dir=
eclipse.preferences.version=1

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,2 @@
connection.project.dir=..
eclipse.preferences.version=1

View File

@ -6,6 +6,7 @@
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
@ -35,5 +36,10 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<receiver android:name=".AlarmReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
</application>
</manifest>

View File

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:flutter_sms/flutter_sms.dart';
void main() => runApp(new MyApp());
@ -12,6 +11,10 @@ class MyApp extends StatefulWidget {
}
class _MyAppState extends State<MyApp> {
TextEditingController _controllerPeople, _controllerMessage;
String _message, body;
List<String> people = [];
@override
void initState() {
super.initState();
@ -19,55 +22,148 @@ class _MyAppState extends State<MyApp> {
}
Future<void> initPlatformState() async {
//Init Data
_controllerPeople = TextEditingController();
_controllerMessage = TextEditingController();
}
void _sendSMS(String message, List<String> recipents) {
String _log = "SMS: $message";
for (var person in recipents) _log += "\n=> $person";
setState(() => _message = "$_log");
void _sendSMS(String message, List<String> recipents) async {
String _result =
await FlutterSms.sendSMS(message: message, recipients: recipents);
setState(() => _message = _result);
}
String _message = "";
Widget _phoneTile(String name) {
return Padding(
padding: const EdgeInsets.all(3.0),
child: Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(color: Colors.grey[300]),
top: BorderSide(color: Colors.grey[300]),
left: BorderSide(color: Colors.grey[300]),
right: BorderSide(color: Colors.grey[300]),
)),
child: Padding(
padding: EdgeInsets.all(4.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
IconButton(
icon: Icon(Icons.close),
onPressed: () => setState(() => people.remove(name)),
),
Padding(
padding: const EdgeInsets.all(0.0),
child: Text(
name,
textScaleFactor: 1.0,
style: TextStyle(fontSize: 12.0),
),
)
],
),
)),
);
}
@override
Widget build(BuildContext context) {
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: const Text('Plugin example app'),
title: const Text('SMS/MMS Example'),
),
body: SingleChildScrollView(
child: Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(12.0),
child: Text(
_message ?? "No Message",
maxLines: null,
body: ListView(
children: <Widget>[
people == null || people.isEmpty
? Container(
height: 0.0,
)
: Container(
height: 90.0,
child: Padding(
padding: const EdgeInsets.all(3.0),
child: ListView(
scrollDirection: Axis.horizontal,
children:
List<Widget>.generate(people.length, (int index) {
return _phoneTile(people[index]);
}),
),
),
),
],
ListTile(
leading: Icon(Icons.people),
title: TextField(
controller: _controllerPeople,
decoration: InputDecoration(labelText: "Add Phone Number"),
onChanged: (String value) => setState(() {}),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
RaisedButton(
child: Text('Send SMS'),
onPressed: () {
_sendSMS(
"Test", ["5551231234", "5551581234", "5551301234"]);
},
trailing: IconButton(
icon: Icon(Icons.add),
onPressed: _controllerPeople.text.isEmpty
? null
: () => setState(() {
people.add(_controllerPeople.text.toString());
_controllerPeople.clear();
}),
),
),
Divider(),
ListTile(
leading: Icon(Icons.message),
title: TextField(
decoration: InputDecoration(labelText: " Add Message"),
controller: _controllerMessage,
onChanged: (String value) => setState(() {}),
),
trailing: IconButton(
icon: Icon(Icons.save),
onPressed: _controllerMessage.text.isEmpty
? null
: () => setState(() {
body = _controllerMessage.text.toString();
_controllerMessage.clear();
}),
),
),
Divider(),
ListTile(
leading: Icon(Icons.text_fields),
title: Text(body ?? "No Message Set"),
subtitle: people == null || people.isEmpty
? null
: Text(people.toString()),
trailing: IconButton(
icon: Icon(Icons.send),
onPressed: () {
if ((people == null || people.isEmpty) ||
(body == null || body.isEmpty)) {
setState(() =>
_message = "At Least 1 Person or Message Required");
} else {
_sendSMS(body, people);
}
},
),
),
Divider(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(12.0),
child: Text(
_message ?? "No Data",
maxLines: null,
),
],
),
],
),
),
],
),
],
),
),
);

View File

@ -1,14 +1,49 @@
import Flutter
import UIKit
public class SwiftFlutterSmsPlugin: NSObject, FlutterPlugin {
import MessageUI
public class SwiftFlutterSmsPlugin: NSObject, FlutterPlugin, UINavigationControllerDelegate, MFMessageComposeViewControllerDelegate {
var message = "Please Send Message"
var _arguments = [String: Any]()
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "flutter_sms", binaryMessenger: registrar.messenger())
let channel = FlutterMethodChannel(name: "flutter_sms", binaryMessenger: registrar.messenger())
let instance = SwiftFlutterSmsPlugin()
registrar.addMethodCallDelegate(instance, channel: channel)
}
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
result("iOS " + UIDevice.current.systemVersion)
_arguments = call.arguments as! [String : Any];
switch call.method {
case "sendSMS":
let controller = MFMessageComposeViewController()
controller.body = _arguments["message"] as? String
controller.recipients = _arguments["recipients"] as? [String]
controller.messageComposeDelegate = self
UIApplication.shared.keyWindow?.rootViewController?.present(controller, animated: true, completion: nil)
result(message)
default:
result(FlutterMethodNotImplemented)
break
}
}
public func messageComposeViewController(_ controller: MFMessageComposeViewController, didFinishWith result: MessageComposeResult) {
UIApplication.shared.keyWindow?.rootViewController?.dismiss(animated: true, completion: nil)
message = "Sent!"
}
private func saveToFile(image: UIImage) -> Any {
guard let data = UIImageJPEGRepresentation(image, 1.0) else {
return FlutterError(code: "image_encoding_error", message: "Could not read image", details: nil)
}
let tempDir = NSTemporaryDirectory()
let imageName = "image_picker_\(ProcessInfo().globallyUniqueString).jpg"
let filePath = tempDir.appending(imageName)
if FileManager.default.createFile(atPath: filePath, contents: data, attributes: nil) {
return filePath
} else {
return FlutterError(code: "image_save_failed", message: "Could not save image to disk", details: nil)
}
}
}

Binary file not shown.

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
</dict>
</plist>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
</dict>
</plist>

View File

@ -1 +0,0 @@
#include "Generated.xcconfig"

View File

@ -1,50 +0,0 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLUTTER_H_
#define FLUTTER_FLUTTER_H_
/**
BREAKING CHANGES:
February 28, 2018: Removed "initWithFLXArchive" and
"initWithFLXArchiveWithScriptSnapshot".
January 15, 2018: Marked "initWithFLXArchive" and
"initWithFLXArchiveWithScriptSnapshot" as unavailable following the
deprecation from December 11, 2017. Scheduled to be removed on February
19, 2018.
January 09, 2018: Deprecated "FlutterStandardBigInteger" and its use in
"FlutterStandardMessageCodec" and "FlutterStandardMethodCodec". Scheduled to
be marked as unavailable once the deprecation has been available on the
flutter/flutter alpha branch for four weeks. "FlutterStandardBigInteger" was
needed because the Dart 1.0 int type had no size limit. With Dart 2.0, the
int type is a fixed-size, 64-bit signed integer. If you need to communicate
larger integers, use NSString encoding instead.
December 11, 2017: Deprecated "initWithFLXArchive" and
"initWithFLXArchiveWithScriptSnapshot" and scheculed the same to be marked as
unavailable on January 15, 2018. Instead, "initWithFlutterAssets" and
"initWithFlutterAssetsWithScriptSnapshot" should be used. The reason for this
change is that the FLX archive will be deprecated and replaced with a flutter
assets directory containing the same files as the FLX did.
November 29, 2017: Added a BREAKING CHANGES section.
*/
#include "FlutterAppDelegate.h"
#include "FlutterBinaryMessenger.h"
#include "FlutterChannels.h"
#include "FlutterCodecs.h"
#include "FlutterDartProject.h"
#include "FlutterHeadlessDartRunner.h"
#include "FlutterMacros.h"
#include "FlutterNavigationController.h"
#include "FlutterPlugin.h"
#include "FlutterPluginAppLifeCycleDelegate.h"
#include "FlutterTexture.h"
#include "FlutterViewController.h"
#endif // FLUTTER_FLUTTER_H_

View File

@ -1,33 +0,0 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLUTTERAPPDELEGATE_H_
#define FLUTTER_FLUTTERAPPDELEGATE_H_
#import <UIKit/UIKit.h>
#include "FlutterMacros.h"
#include "FlutterPlugin.h"
/**
* UIApplicationDelegate subclass for simple apps that want default behavior.
*
* This class provides the following behaviors:
* * Status bar touches are forwarded to the key window's root view
* FlutterViewController, in order to trigger scroll to top.
* * Keeps the Flutter connection open in debug mode when the phone screen
* locks.
*
* App delegates for Flutter applications are *not* required to inherit from
* this class. Developers of custom app delegate classes should copy and paste
* code as necessary from FlutterAppDelegate.mm.
*/
FLUTTER_EXPORT
@interface FlutterAppDelegate : UIResponder<UIApplicationDelegate, FlutterPluginRegistry, FlutterAppLifeCycleProvider>
@property(strong, nonatomic) UIWindow* window;
@end
#endif // FLUTTER_FLUTTERDARTPROJECT_H_

View File

@ -1,85 +0,0 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLUTTERBINARYMESSENGER_H_
#define FLUTTER_FLUTTERBINARYMESSENGER_H_
#import <Foundation/Foundation.h>
#include "FlutterMacros.h"
NS_ASSUME_NONNULL_BEGIN
/**
A message reply callback.
Used for submitting a binary reply back to a Flutter message sender. Also used
in the dual capacity for handling a binary message reply received from Flutter.
- Parameters:
- reply: The reply.
*/
typedef void (^FlutterBinaryReply)(NSData* _Nullable reply);
/**
A strategy for handling incoming binary messages from Flutter and to send
asynchronous replies back to Flutter.
- Parameters:
- message: The message.
- reply: A callback for submitting a reply to the sender.
*/
typedef void (^FlutterBinaryMessageHandler)(NSData* _Nullable message, FlutterBinaryReply reply);
/**
A facility for communicating with the Flutter side using asynchronous message
passing with binary messages.
- SeeAlso:
- `FlutterBasicMessageChannel`, which supports communication using structured
messages.
- `FlutterMethodChannel`, which supports communication using asynchronous
method calls.
- `FlutterEventChannel`, which supports commuication using event streams.
*/
FLUTTER_EXPORT
@protocol FlutterBinaryMessenger<NSObject>
/**
Sends a binary message to the Flutter side on the specified channel, expecting
no reply.
- Parameters:
- channel: The channel name.
- message: The message.
*/
- (void)sendOnChannel:(NSString*)channel message:(NSData* _Nullable)message;
/**
Sends a binary message to the Flutter side on the specified channel, expecting
an asynchronous reply.
- Parameters:
- channel: The channel name.
- message: The message.
- callback: A callback for receiving a reply.
*/
- (void)sendOnChannel:(NSString*)channel
message:(NSData* _Nullable)message
binaryReply:(FlutterBinaryReply _Nullable)callback;
/**
Registers a message handler for incoming binary messages from the Flutter side
on the specified channel.
Replaces any existing handler. Use a `nil` handler for unregistering the
existing handler.
- Parameters:
- channel: The channel name.
- handler: The message handler.
*/
- (void)setMessageHandlerOnChannel:(NSString*)channel
binaryMessageHandler:(FlutterBinaryMessageHandler _Nullable)handler;
@end
NS_ASSUME_NONNULL_END
#endif // FLUTTER_FLUTTERBINARYMESSENGER_H_

View File

@ -1,384 +0,0 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLUTTERCHANNELS_H_
#define FLUTTER_FLUTTERCHANNELS_H_
#include "FlutterBinaryMessenger.h"
#include "FlutterCodecs.h"
NS_ASSUME_NONNULL_BEGIN
/**
A message reply callback.
Used for submitting a reply back to a Flutter message sender. Also used in
the dual capacity for handling a message reply received from Flutter.
- Parameter reply: The reply.
*/
typedef void (^FlutterReply)(id _Nullable reply);
/**
A strategy for handling incoming messages from Flutter and to send
asynchronous replies back to Flutter.
- Parameters:
- message: The message.
- reply: A callback for submitting a reply to the sender.
*/
typedef void (^FlutterMessageHandler)(id _Nullable message, FlutterReply callback);
/**
A channel for communicating with the Flutter side using basic, asynchronous
message passing.
*/
FLUTTER_EXPORT
@interface FlutterBasicMessageChannel : NSObject
/**
Creates a `FlutterBasicMessageChannel` with the specified name and binary
messenger.
The channel name logically identifies the channel; identically named channels
interfere with each other's communication.
The binary messenger is a facility for sending raw, binary messages to the
Flutter side. This protocol is implemented by `FlutterViewController`.
The channel uses `FlutterStandardMessageCodec` to encode and decode messages.
- Parameters:
- name: The channel name.
- messenger: The binary messenger.
*/
+ (instancetype)messageChannelWithName:(NSString*)name
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger;
/**
Creates a `FlutterBasicMessageChannel` with the specified name, binary
messenger,
and message codec.
The channel name logically identifies the channel; identically named channels
interfere with each other's communication.
The binary messenger is a facility for sending raw, binary messages to the
Flutter side. This protocol is implemented by `FlutterViewController`.
- Parameters:
- name: The channel name.
- messenger: The binary messenger.
- codec: The message codec.
*/
+ (instancetype)messageChannelWithName:(NSString*)name
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger
codec:(NSObject<FlutterMessageCodec>*)codec;
/**
Initializes a `FlutterBasicMessageChannel` with the specified name, binary
messenger, and message codec.
The channel name logically identifies the channel; identically named channels
interfere with each other's communication.
The binary messenger is a facility for sending raw, binary messages to the
Flutter side. This protocol is implemented by `FlutterViewController`.
- Parameters:
- name: The channel name.
- messenger: The binary messenger.
- codec: The message codec.
*/
- (instancetype)initWithName:(NSString*)name
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger
codec:(NSObject<FlutterMessageCodec>*)codec;
/**
Sends the specified message to the Flutter side, ignoring any reply.
- Parameter message: The message. Must be supported by the codec of this
channel.
*/
- (void)sendMessage:(id _Nullable)message;
/**
Sends the specified message to the Flutter side, expecting an asynchronous
reply.
- Parameters:
- message: The message. Must be supported by the codec of this channel.
- callback: A callback to be invoked with the message reply from Flutter.
*/
- (void)sendMessage:(id _Nullable)message reply:(FlutterReply _Nullable)callback;
/**
Registers a message handler with this channel.
Replaces any existing handler. Use a `nil` handler for unregistering the
existing handler.
- Parameter handler: The message handler.
*/
- (void)setMessageHandler:(FlutterMessageHandler _Nullable)handler;
@end
/**
A method call result callback.
Used for submitting a method call result back to a Flutter caller. Also used in
the dual capacity for handling a method call result received from Flutter.
- Parameter result: The result.
*/
typedef void (^FlutterResult)(id _Nullable result);
/**
A strategy for handling method calls.
- Parameters:
- call: The incoming method call.
- result: A callback to asynchronously submit the result of the call.
Invoke the callback with a `FlutterError` to indicate that the call failed.
Invoke the callback with `FlutterMethodNotImplemented` to indicate that the
method was unknown. Any other values, including `nil`, are interpreted as
successful results.
*/
typedef void (^FlutterMethodCallHandler)(FlutterMethodCall* call, FlutterResult result);
/**
A constant used with `FlutterMethodCallHandler` to respond to the call of an
unknown method.
*/
FLUTTER_EXPORT
extern NSObject const* FlutterMethodNotImplemented;
/**
A channel for communicating with the Flutter side using invocation of
asynchronous methods.
*/
FLUTTER_EXPORT
@interface FlutterMethodChannel : NSObject
/**
Creates a `FlutterMethodChannel` with the specified name and binary messenger.
The channel name logically identifies the channel; identically named channels
interfere with each other's communication.
The binary messenger is a facility for sending raw, binary messages to the
Flutter side. This protocol is implemented by `FlutterViewController`.
The channel uses `FlutterStandardMethodCodec` to encode and decode method calls
and result envelopes.
- Parameters:
- name: The channel name.
- messenger: The binary messenger.
*/
+ (instancetype)methodChannelWithName:(NSString*)name
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger;
/**
Creates a `FlutterMethodChannel` with the specified name, binary messenger, and
method codec.
The channel name logically identifies the channel; identically named channels
interfere with each other's communication.
The binary messenger is a facility for sending raw, binary messages to the
Flutter side. This protocol is implemented by `FlutterViewController`.
- Parameters:
- name: The channel name.
- messenger: The binary messenger.
- codec: The method codec.
*/
+ (instancetype)methodChannelWithName:(NSString*)name
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger
codec:(NSObject<FlutterMethodCodec>*)codec;
/**
Initializes a `FlutterMethodChannel` with the specified name, binary messenger,
and method codec.
The channel name logically identifies the channel; identically named channels
interfere with each other's communication.
The binary messenger is a facility for sending raw, binary messages to the
Flutter side. This protocol is implemented by `FlutterViewController`.
- Parameters:
- name: The channel name.
- messenger: The binary messenger.
- codec: The method codec.
*/
- (instancetype)initWithName:(NSString*)name
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger
codec:(NSObject<FlutterMethodCodec>*)codec;
/**
Invokes the specified Flutter method with the specified arguments, expecting
no results.
- Parameters:
- method: The name of the method to invoke.
- arguments: The arguments. Must be a value supported by the codec of this
channel.
*/
- (void)invokeMethod:(NSString*)method arguments:(id _Nullable)arguments;
/**
Invokes the specified Flutter method with the specified arguments, expecting
an asynchronous result.
- Parameters:
- method: The name of the method to invoke.
- arguments: The arguments. Must be a value supported by the codec of this
channel.
- result: A callback that will be invoked with the asynchronous result.
The result will be a `FlutterError` instance, if the method call resulted
in an error on the Flutter side. Will be `FlutterMethodNotImplemented`, if
the method called was not implemented on the Flutter side. Any other value,
including `nil`, should be interpreted as successful results.
*/
- (void)invokeMethod:(NSString*)method
arguments:(id _Nullable)arguments
result:(FlutterResult _Nullable)callback;
/**
Registers a handler for method calls from the Flutter side.
Replaces any existing handler. Use a `nil` handler for unregistering the
existing handler.
- Parameter handler: The method call handler.
*/
- (void)setMethodCallHandler:(FlutterMethodCallHandler _Nullable)handler;
@end
/**
An event sink callback.
- Parameter event: The event.
*/
typedef void (^FlutterEventSink)(id _Nullable event);
/**
A strategy for exposing an event stream to the Flutter side.
*/
FLUTTER_EXPORT
@protocol FlutterStreamHandler
/**
Sets up an event stream and begin emitting events.
Invoked when the first listener is registered with the Stream associated to
this channel on the Flutter side.
- Parameters:
- arguments: Arguments for the stream.
- events: A callback to asynchronously emit events. Invoke the
callback with a `FlutterError` to emit an error event. Invoke the
callback with `FlutterEndOfEventStream` to indicate that no more
events will be emitted. Any other value, including `nil` are emitted as
successful events.
- Returns: A FlutterError instance, if setup fails.
*/
- (FlutterError* _Nullable)onListenWithArguments:(id _Nullable)arguments
eventSink:(FlutterEventSink)events;
/**
Tears down an event stream.
Invoked when the last listener is deregistered from the Stream associated to
this channel on the Flutter side.
The channel implementation may call this method with `nil` arguments
to separate a pair of two consecutive set up requests. Such request pairs
may occur during Flutter hot restart.
- Parameter arguments: Arguments for the stream.
- Returns: A FlutterError instance, if teardown fails.
*/
- (FlutterError* _Nullable)onCancelWithArguments:(id _Nullable)arguments;
@end
/**
A constant used with `FlutterEventChannel` to indicate end of stream.
*/
FLUTTER_EXPORT
extern NSObject const* FlutterEndOfEventStream;
/**
A channel for communicating with the Flutter side using event streams.
*/
FLUTTER_EXPORT
@interface FlutterEventChannel : NSObject
/**
Creates a `FlutterEventChannel` with the specified name and binary messenger.
The channel name logically identifies the channel; identically named channels
interfere with each other's communication.
The binary messenger is a facility for sending raw, binary messages to the
Flutter side. This protocol is implemented by `FlutterViewController`.
The channel uses `FlutterStandardMethodCodec` to decode stream setup and
teardown requests, and to encode event envelopes.
- Parameters:
- name: The channel name.
- messenger: The binary messenger.
- codec: The method codec.
*/
+ (instancetype)eventChannelWithName:(NSString*)name
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger;
/**
Creates a `FlutterEventChannel` with the specified name, binary messenger,
and method codec.
The channel name logically identifies the channel; identically named channels
interfere with each other's communication.
The binary messenger is a facility for sending raw, binary messages to the
Flutter side. This protocol is implemented by `FlutterViewController`.
- Parameters:
- name: The channel name.
- messenger: The binary messenger.
- codec: The method codec.
*/
+ (instancetype)eventChannelWithName:(NSString*)name
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger
codec:(NSObject<FlutterMethodCodec>*)codec;
/**
Initializes a `FlutterEventChannel` with the specified name, binary messenger,
and method codec.
The channel name logically identifies the channel; identically named channels
interfere with each other's communication.
The binary messenger is a facility for sending raw, binary messages to the
Flutter side. This protocol is implemented by `FlutterViewController`.
- Parameters:
- name: The channel name.
- messenger: The binary messenger.
- codec: The method codec.
*/
- (instancetype)initWithName:(NSString*)name
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger
codec:(NSObject<FlutterMethodCodec>*)codec;
/**
Registers a handler for stream setup requests from the Flutter side.
Replaces any existing handler. Use a `nil` handler for unregistering the
existing handler.
- Parameter handler: The stream handler.
*/
- (void)setStreamHandler:(NSObject<FlutterStreamHandler>* _Nullable)handler;
@end
NS_ASSUME_NONNULL_END
#endif // FLUTTER_FLUTTERCHANNELS_H_

View File

@ -1,433 +0,0 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLUTTERCODECS_H_
#define FLUTTER_FLUTTERCODECS_H_
#import <Foundation/Foundation.h>
#include "FlutterMacros.h"
NS_ASSUME_NONNULL_BEGIN
/**
A message encoding/decoding mechanism.
*/
FLUTTER_EXPORT
@protocol FlutterMessageCodec
/**
Returns a shared instance of this `FlutterMessageCodec`.
*/
+ (instancetype)sharedInstance;
/**
Encodes the specified message into binary.
- Parameter message: The message.
- Returns: The binary encoding, or `nil`, if `message` was `nil`.
*/
- (NSData* _Nullable)encode:(id _Nullable)message;
/**
Decodes the specified message from binary.
- Parameter message: The message.
- Returns: The decoded message, or `nil`, if `message` was `nil`.
*/
- (id _Nullable)decode:(NSData* _Nullable)message;
@end
/**
A `FlutterMessageCodec` using unencoded binary messages, represented as
`NSData` instances.
This codec is guaranteed to be compatible with the corresponding
[BinaryCodec](https://docs.flutter.io/flutter/services/BinaryCodec-class.html)
on the Dart side. These parts of the Flutter SDK are evolved synchronously.
On the Dart side, messages are represented using `ByteData`.
*/
FLUTTER_EXPORT
@interface FlutterBinaryCodec : NSObject <FlutterMessageCodec>
@end
/**
A `FlutterMessageCodec` using UTF-8 encoded `NSString` messages.
This codec is guaranteed to be compatible with the corresponding
[StringCodec](https://docs.flutter.io/flutter/services/StringCodec-class.html)
on the Dart side. These parts of the Flutter SDK are evolved synchronously.
*/
FLUTTER_EXPORT
@interface FlutterStringCodec : NSObject <FlutterMessageCodec>
@end
/**
A `FlutterMessageCodec` using UTF-8 encoded JSON messages.
This codec is guaranteed to be compatible with the corresponding
[JSONMessageCodec](https://docs.flutter.io/flutter/services/JSONMessageCodec-class.html)
on the Dart side. These parts of the Flutter SDK are evolved synchronously.
Supports values accepted by `NSJSONSerialization` plus top-level
`nil`, `NSNumber`, and `NSString`.
On the Dart side, JSON messages are handled by the JSON facilities of the
[`dart:convert`](https://api.dartlang.org/stable/dart-convert/JSON-constant.html)
package.
*/
FLUTTER_EXPORT
@interface FlutterJSONMessageCodec : NSObject <FlutterMessageCodec>
@end
/**
A writer of the Flutter standard binary encoding.
See `FlutterStandardMessageCodec` for details on the encoding.
The encoding is extensible via subclasses overriding `writeValue`.
*/
FLUTTER_EXPORT
@interface FlutterStandardWriter : NSObject
- (instancetype)initWithData:(NSMutableData*)data;
- (void)writeByte:(UInt8)value;
- (void)writeBytes:(const void*)bytes length:(NSUInteger)length;
- (void)writeData:(NSData*)data;
- (void)writeSize:(UInt32)size;
- (void)writeAlignment:(UInt8)alignment;
- (void)writeUTF8:(NSString*)value;
- (void)writeValue:(id)value;
@end
/**
A reader of the Flutter standard binary encoding.
See `FlutterStandardMessageCodec` for details on the encoding.
The encoding is extensible via subclasses overriding `readValueOfType`.
*/
FLUTTER_EXPORT
@interface FlutterStandardReader : NSObject
- (instancetype)initWithData:(NSData*)data;
- (BOOL)hasMore;
- (UInt8)readByte;
- (void)readBytes:(void*)destination length:(NSUInteger)length;
- (NSData*)readData:(NSUInteger)length;
- (UInt32)readSize;
- (void)readAlignment:(UInt8)alignment;
- (NSString*)readUTF8;
- (id)readValue;
- (id)readValueOfType:(UInt8)type;
@end
/**
A factory of compatible reader/writer instances using the Flutter standard
binary encoding or extensions thereof.
*/
FLUTTER_EXPORT
@interface FlutterStandardReaderWriter : NSObject
- (FlutterStandardWriter*)writerWithData:(NSMutableData*)data;
- (FlutterStandardReader*)readerWithData:(NSData*)data;
@end
/**
A `FlutterMessageCodec` using the Flutter standard binary encoding.
This codec is guaranteed to be compatible with the corresponding
[StandardMessageCodec](https://docs.flutter.io/flutter/services/StandardMessageCodec-class.html)
on the Dart side. These parts of the Flutter SDK are evolved synchronously.
Supported messages are acyclic values of these forms:
- `nil` or `NSNull`
- `NSNumber` (including their representation of Boolean values)
- `NSString`
- `FlutterStandardTypedData`
- `NSArray` of supported values
- `NSDictionary` with supported keys and values
On the Dart side, these values are represented as follows:
- `nil` or `NSNull`: null
- `NSNumber`: `bool`, `int`, or `double`, depending on the contained value.
- `NSString`: `String`
- `FlutterStandardTypedData`: `Uint8List`, `Int32List`, `Int64List`, or `Float64List`
- `NSArray`: `List`
- `NSDictionary`: `Map`
Support for `FlutterStandardBigInteger` has been deprecated on 2018-01-09 to be
made unavailable four weeks after this change is available on the Flutter alpha
branch. `FlutterStandardBigInteger` were needed because the Dart 1.0 `int` type
had no size limit. With Dart 2.0, the `int` type is a fixed-size, 64-bit signed
integer. If you need to communicate larger integers, use `NSString` encoding
instead.
*/
FLUTTER_EXPORT
@interface FlutterStandardMessageCodec : NSObject <FlutterMessageCodec>
+ (instancetype)codecWithReaderWriter:(FlutterStandardReaderWriter*)readerWriter;
@end
/**
Command object representing a method call on a `FlutterMethodChannel`.
*/
FLUTTER_EXPORT
@interface FlutterMethodCall : NSObject
/**
Creates a method call for invoking the specified named method with the
specified arguments.
- Parameters:
- method: the name of the method to call.
- arguments: the arguments value.
*/
+ (instancetype)methodCallWithMethodName:(NSString*)method arguments:(id _Nullable)arguments;
/**
The method name.
*/
@property(readonly, nonatomic) NSString* method;
/**
The arguments.
*/
@property(readonly, nonatomic, nullable) id arguments;
@end
/**
Error object representing an unsuccessful outcome of invoking a method
on a `FlutterMethodChannel`, or an error event on a `FlutterEventChannel`.
*/
FLUTTER_EXPORT
@interface FlutterError : NSObject
/**
Creates a `FlutterError` with the specified error code, message, and details.
- Parameters:
- code: An error code string for programmatic use.
- message: A human-readable error message.
- details: Custom error details.
*/
+ (instancetype)errorWithCode:(NSString*)code
message:(NSString* _Nullable)message
details:(id _Nullable)details;
/**
The error code.
*/
@property(readonly, nonatomic) NSString* code;
/**
The error message.
*/
@property(readonly, nonatomic, nullable) NSString* message;
/**
The error details.
*/
@property(readonly, nonatomic, nullable) id details;
@end
/**
Type of numeric data items encoded in a `FlutterStandardDataType`.
- FlutterStandardDataTypeUInt8: plain bytes
- FlutterStandardDataTypeInt32: 32-bit signed integers
- FlutterStandardDataTypeInt64: 64-bit signed integers
- FlutterStandardDataTypeFloat64: 64-bit floats
*/
typedef NS_ENUM(NSInteger, FlutterStandardDataType) {
FlutterStandardDataTypeUInt8,
FlutterStandardDataTypeInt32,
FlutterStandardDataTypeInt64,
FlutterStandardDataTypeFloat64,
};
/**
A byte buffer holding `UInt8`, `SInt32`, `SInt64`, or `Float64` values, used
with `FlutterStandardMessageCodec` and `FlutterStandardMethodCodec`.
Two's complement encoding is used for signed integers. IEEE754
double-precision representation is used for floats. The platform's native
endianness is assumed.
*/
FLUTTER_EXPORT
@interface FlutterStandardTypedData : NSObject
/**
Creates a `FlutterStandardTypedData` which interprets the specified data
as plain bytes.
- Parameter data: the byte data.
*/
+ (instancetype)typedDataWithBytes:(NSData*)data;
/**
Creates a `FlutterStandardTypedData` which interprets the specified data
as 32-bit signed integers.
- Parameter data: the byte data. The length must be divisible by 4.
*/
+ (instancetype)typedDataWithInt32:(NSData*)data;
/**
Creates a `FlutterStandardTypedData` which interprets the specified data
as 64-bit signed integers.
- Parameter data: the byte data. The length must be divisible by 8.
*/
+ (instancetype)typedDataWithInt64:(NSData*)data;
/**
Creates a `FlutterStandardTypedData` which interprets the specified data
as 64-bit floats.
- Parameter data: the byte data. The length must be divisible by 8.
*/
+ (instancetype)typedDataWithFloat64:(NSData*)data;
/**
The raw underlying data buffer.
*/
@property(readonly, nonatomic) NSData* data;
/**
The type of the encoded values.
*/
@property(readonly, nonatomic) FlutterStandardDataType type;
/**
The number of value items encoded.
*/
@property(readonly, nonatomic) UInt32 elementCount;
/**
The number of bytes used by the encoding of a single value item.
*/
@property(readonly, nonatomic) UInt8 elementSize;
@end
/**
An arbitrarily large integer value, used with `FlutterStandardMessageCodec`
and `FlutterStandardMethodCodec`.
*/
FLUTTER_EXPORT
FLUTTER_DEPRECATED(
"Deprecated on 2018-01-09 to be made unavailable four weeks after the "
"deprecation is available on the flutter/flutter alpha branch. "
"FlutterStandardBigInteger was needed because the Dart 1.0 int type had no "
"size limit. With Dart 2.0, the int type is a fixed-size, 64-bit signed "
"integer. If you need to communicate larger integers, use NSString encoding "
"instead.")
@interface FlutterStandardBigInteger : NSObject
/**
Creates a `FlutterStandardBigInteger` from a hexadecimal representation.
- Parameter hex: a hexadecimal string.
*/
+ (instancetype)bigIntegerWithHex:(NSString*)hex;
/**
The hexadecimal string representation of this integer.
*/
@property(readonly, nonatomic) NSString* hex;
@end
/**
A codec for method calls and enveloped results.
Method calls are encoded as binary messages with enough structure that the
codec can extract a method name `NSString` and an arguments `NSObject`,
possibly `nil`. These data items are used to populate a `FlutterMethodCall`.
Result envelopes are encoded as binary messages with enough structure that
the codec can determine whether the result was successful or an error. In
the former case, the codec can extract the result `NSObject`, possibly `nil`.
In the latter case, the codec can extract an error code `NSString`, a
human-readable `NSString` error message (possibly `nil`), and a custom
error details `NSObject`, possibly `nil`. These data items are used to
populate a `FlutterError`.
*/
FLUTTER_EXPORT
@protocol FlutterMethodCodec
/**
Provides access to a shared instance this codec.
- Returns: The shared instance.
*/
+ (instancetype)sharedInstance;
/**
Encodes the specified method call into binary.
- Parameter methodCall: The method call. The arguments value
must be supported by this codec.
- Returns: The binary encoding.
*/
- (NSData*)encodeMethodCall:(FlutterMethodCall*)methodCall;
/**
Decodes the specified method call from binary.
- Parameter methodCall: The method call to decode.
- Returns: The decoded method call.
*/
- (FlutterMethodCall*)decodeMethodCall:(NSData*)methodCall;
/**
Encodes the specified successful result into binary.
- Parameter result: The result. Must be a value supported by this codec.
- Returns: The binary encoding.
*/
- (NSData*)encodeSuccessEnvelope:(id _Nullable)result;
/**
Encodes the specified error result into binary.
- Parameter error: The error object. The error details value must be supported
by this codec.
- Returns: The binary encoding.
*/
- (NSData*)encodeErrorEnvelope:(FlutterError*)error;
/**
Deccodes the specified result envelope from binary.
- Parameter error: The error object.
- Returns: The result value, if the envelope represented a successful result,
or a `FlutterError` instance, if not.
*/
- (id _Nullable)decodeEnvelope:(NSData*)envelope;
@end
/**
A `FlutterMethodCodec` using UTF-8 encoded JSON method calls and result
envelopes.
This codec is guaranteed to be compatible with the corresponding
[JSONMethodCodec](https://docs.flutter.io/flutter/services/JSONMethodCodec-class.html)
on the Dart side. These parts of the Flutter SDK are evolved synchronously.
Values supported as methods arguments and result payloads are
those supported as top-level or leaf values by `FlutterJSONMessageCodec`.
*/
FLUTTER_EXPORT
@interface FlutterJSONMethodCodec : NSObject <FlutterMethodCodec>
@end
/**
A `FlutterMethodCodec` using the Flutter standard binary encoding.
This codec is guaranteed to be compatible with the corresponding
[StandardMethodCodec](https://docs.flutter.io/flutter/services/StandardMethodCodec-class.html)
on the Dart side. These parts of the Flutter SDK are evolved synchronously.
Values supported as method arguments and result payloads are those supported by
`FlutterStandardMessageCodec`.
*/
FLUTTER_EXPORT
@interface FlutterStandardMethodCodec : NSObject <FlutterMethodCodec>
+ (instancetype)codecWithReaderWriter:(FlutterStandardReaderWriter*)readerWriter;
@end
NS_ASSUME_NONNULL_END
#endif // FLUTTER_FLUTTERCODECS_H_

View File

@ -1,48 +0,0 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLUTTERDARTPROJECT_H_
#define FLUTTER_FLUTTERDARTPROJECT_H_
#import <Foundation/Foundation.h>
#include "FlutterMacros.h"
FLUTTER_EXPORT
@interface FlutterDartProject : NSObject
- (instancetype)initWithPrecompiledDartBundle:(NSBundle*)bundle NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithFlutterAssets:(NSURL*)flutterAssetsURL
dartMain:(NSURL*)dartMainURL
packages:(NSURL*)dartPackages NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL
NS_DESIGNATED_INITIALIZER;
- (instancetype)initFromDefaultSourceForConfiguration;
/**
Returns the file name for the given asset.
The returned file name can be used to access the asset in the application's main bundle.
- Parameter asset: The name of the asset. The name can be hierarchical.
- Returns: the file name to be used for lookup in the main bundle.
*/
+ (NSString*)lookupKeyForAsset:(NSString*)asset;
/**
Returns the file name for the given asset which originates from the specified package.
The returned file name can be used to access the asset in the application's main bundle.
- Parameters:
- asset: The name of the asset. The name can be hierarchical.
- package: The name of the package from which the asset originates.
- Returns: the file name to be used for lookup in the main bundle.
*/
+ (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package;
@end
#endif // FLUTTER_FLUTTERDARTPROJECT_H_

View File

@ -1,34 +0,0 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLUTTERHEADLESSDARTRUNNER_H_
#define FLUTTER_FLUTTERHEADLESSDARTRUNNER_H_
#import <Foundation/Foundation.h>
#include "FlutterDartProject.h"
#include "FlutterMacros.h"
/**
The FlutterHeadlessDartRunner runs Flutter Dart code with a null rasterizer,
and no native drawing surface. It is appropriate for use in running Dart
code e.g. in the background from a plugin.
*/
FLUTTER_EXPORT
@interface FlutterHeadlessDartRunner : NSObject
/**
Runs a Dart function on an Isolate that is not the main application's Isolate.
The first call will create a new Isolate. Subsequent calls will reuse that
Isolate. The Isolate is destroyed when the FlutterHeadlessDartRunner is
destroyed.
- Parameter entrypoint: The name of a top-level function from the same Dart
library that contains the app's main() function.
*/
- (void)runWithEntrypoint:(NSString*)entrypoint;
@end
#endif // FLUTTER_FLUTTERHEADLESSDARTRUNNER_H_

View File

@ -1,40 +0,0 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLUTTERMACROS_H_
#define FLUTTER_FLUTTERMACROS_H_
#if defined(FLUTTER_FRAMEWORK)
#define FLUTTER_EXPORT __attribute__((visibility("default")))
#else // defined(FLUTTER_SDK)
#define FLUTTER_EXPORT
#endif // defined(FLUTTER_SDK)
#ifndef NS_ASSUME_NONNULL_BEGIN
#define NS_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
#define NS_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
#endif // defined(NS_ASSUME_NONNULL_BEGIN)
/**
Indicates that the API has been deprecated for the specifed reason. Code that
uses the deprecated API will continue to work as before. However, the API will
soon become unavailable and users are encouraged to immediately take the
appropriate action mentioned in the deprecation message and the BREAKING
CHANGES section present in the Flutter.h umbrella header.
*/
#define FLUTTER_DEPRECATED(msg) __attribute__((__deprecated__(msg)))
/**
Indicates that the previously deprecated API is now unavailable. Code that
uses the API will not work and the declaration of the API is only a stub meant
to display the given message detailing the actions for the user to take
immediately.
*/
#define FLUTTER_UNAVAILABLE(msg) __attribute__((__unavailable__(msg)))
#endif // FLUTTER_FLUTTERMACROS_H_

View File

@ -1,9 +0,0 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <UIKit/UIKit.h>
@interface FlutterNavigationController : UINavigationController
@end

View File

@ -1,305 +0,0 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLUTTERPLUGIN_H_
#define FLUTTER_FLUTTERPLUGIN_H_
#import <UIKit/UIKit.h>
#include "FlutterBinaryMessenger.h"
#include "FlutterChannels.h"
#include "FlutterCodecs.h"
#include "FlutterTexture.h"
NS_ASSUME_NONNULL_BEGIN
@protocol FlutterPluginRegistrar;
/**
Implemented by the iOS part of a Flutter plugin.
Defines a set of optional callback methods and a method to set up the plugin
and register it to be called by other application components.
*/
@protocol FlutterPlugin <NSObject>
@required
/**
Registers this plugin using the context information and callback registration
methods exposed by the given registrar.
The registrar is obtained from a `FlutterPluginRegistry` which keeps track of
the identity of registered plugins and provides basic support for cross-plugin
coordination.
The caller of this method, a plugin registrant, is usually autogenerated by
Flutter tooling based on declared plugin dependencies. The generated registrant
asks the registry for a registrar for each plugin, and calls this method to
allow the plugin to initialize itself and register callbacks with application
objects available through the registrar protocol.
- Parameters:
- registrar: A helper providing application context and methods for
registering callbacks.
*/
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar;
@optional
/**
Called if this plugin has been registered to receive `FlutterMethodCall`s.
- Parameters:
- call: The method call command object.
- result: A callback for submitting the result of the call.
*/
- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
- Returns: `NO` if this plugin vetoes application launch.
*/
- (BOOL)application:(UIApplication*)application
didFinishLaunchingWithOptions:(NSDictionary*)launchOptions;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
*/
- (void)applicationDidBecomeActive:(UIApplication*)application;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
*/
- (void)applicationWillResignActive:(UIApplication*)application;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
*/
- (void)applicationDidEnterBackground:(UIApplication*)application;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
*/
- (void)applicationWillEnterForeground:(UIApplication*)application;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
*/
- (void)applicationWillTerminate:(UIApplication*)application;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
*/
- (void)application:(UIApplication*)application
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
*/
- (void)application:(UIApplication*)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
- Returns: `YES` if this plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application
didReceiveRemoteNotification:(NSDictionary*)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
- Returns: `YES` if this plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application
openURL:(NSURL*)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id>*)options;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
- Returns: `YES` if this plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
- Returns: `YES` if this plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application
openURL:(NSURL*)url
sourceApplication:(NSString*)sourceApplication
annotation:(id)annotation;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
- Returns: `YES` if this plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application
performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem
completionHandler:(void (^)(BOOL succeeded))completionHandler
API_AVAILABLE(ios(9.0));
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
- Returns: `YES` if this plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application
handleEventsForBackgroundURLSession:(nonnull NSString*)identifier
completionHandler:(nonnull void (^)(void))completionHandler;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
- Returns: `YES` if this plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application
performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
- Returns: `YES` if this plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application
continueUserActivity:(NSUserActivity*)userActivity
restorationHandler:(void (^)(NSArray*))restorationHandler;
@end
/**
Registration context for a single `FlutterPlugin`, providing a one stop shop
for the plugin to access contextual information and register callbacks for
various application events.
Registrars are obtained from a `FlutterPluginRegistry` which keeps track of
the identity of registered plugins and provides basic support for cross-plugin
coordination.
*/
@protocol FlutterPluginRegistrar <NSObject>
/**
Returns a `FlutterBinaryMessenger` for creating Dart/iOS communication
channels to be used by the plugin.
- Returns: The messenger.
*/
- (NSObject<FlutterBinaryMessenger>*)messenger;
/**
Returns a `FlutterTextureRegistry` for registering textures
provided by the plugin.
- Returns: The texture registry.
*/
- (NSObject<FlutterTextureRegistry>*)textures;
/**
Publishes a value for external use of the plugin.
Plugins may publish a single value, such as an instance of the
plugin's main class, for situations where external control or
interaction is needed.
The published value will be available from the `FlutterPluginRegistry`.
Repeated calls overwrite any previous publication.
- Parameter value: The value to be published.
*/
- (void)publish:(NSObject*)value;
/**
Registers the plugin as a receiver of incoming method calls from the Dart side
on the specified `FlutterMethodChannel`.
- Parameters:
- delegate: The receiving object, such as the plugin's main class.
- channel: The channel
*/
- (void)addMethodCallDelegate:(NSObject<FlutterPlugin>*)delegate
channel:(FlutterMethodChannel*)channel;
/**
Registers the plugin as a receiver of `UIApplicationDelegate` calls.
- Parameters delegate: The receiving object, such as the plugin's main class.
*/
- (void)addApplicationDelegate:(NSObject<FlutterPlugin>*)delegate;
/**
Returns the file name for the given asset.
The returned file name can be used to access the asset in the application's main bundle.
- Parameter asset: The name of the asset. The name can be hierarchical.
- Returns: the file name to be used for lookup in the main bundle.
*/
- (NSString*)lookupKeyForAsset:(NSString*)asset;
/**
Returns the file name for the given asset which originates from the specified package.
The returned file name can be used to access the asset in the application's main bundle.
- Parameters:
- asset: The name of the asset. The name can be hierarchical.
- package: The name of the package from which the asset originates.
- Returns: the file name to be used for lookup in the main bundle.
*/
- (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package;
@end
/**
A registry of Flutter iOS plugins.
Plugins are identified by unique string keys, typically the name of the
plugin's main class. The registry tracks plugins by this key, mapping it to
a value published by the plugin during registration, if any. This provides a
very basic means of cross-plugin coordination with loose coupling between
unrelated plugins.
Plugins typically need contextual information and the ability to register
callbacks for various application events. To keep the API of the registry
focused, these facilities are not provided directly by the registry, but by
a `FlutterPluginRegistrar`, created by the registry in exchange for the unique
key of the plugin.
There is no implied connection between the registry and the registrar.
Specifically, callbacks registered by the plugin via the registrar may be
relayed directly to the underlying iOS application objects.
*/
@protocol FlutterPluginRegistry <NSObject>
/**
Returns a registrar for registering a plugin.
- Parameter pluginKey: The unique key identifying the plugin.
*/
- (NSObject<FlutterPluginRegistrar>*)registrarForPlugin:(NSString*)pluginKey;
/**
Returns whether the specified plugin has been registered.
- Parameter pluginKey: The unique key identifying the plugin.
- Returns: `YES` if `registrarForPlugin` has been called with `pluginKey`.
*/
- (BOOL)hasPlugin:(NSString*)pluginKey;
/**
Returns a value published by the specified plugin.
- Parameter pluginKey: The unique key identifying the plugin.
- Returns: An object published by the plugin, if any. Will be `NSNull` if
nothing has been published. Will be `nil` if the plugin has not been
registered.
*/
- (NSObject*)valuePublishedByPlugin:(NSString*)pluginKey;
@end
/**
Implement this in the `UIAppDelegate` of your app to enable Flutter plugins to register themselves to the application
life cycle events.
*/
@protocol FlutterAppLifeCycleProvider
- (void)addApplicationLifeCycleDelegate:(NSObject<FlutterPlugin>*)delegate;
@end
NS_ASSUME_NONNULL_END;
#endif // FLUTTER_FLUTTERPLUGIN_H_

View File

@ -1,144 +0,0 @@
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_
#define FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_
#include "FlutterPlugin.h"
NS_ASSUME_NONNULL_BEGIN
/**
Propagates `UIAppDelegate` callbacks to registered plugins.
*/
FLUTTER_EXPORT
@interface FlutterPluginAppLifeCycleDelegate : NSObject
/**
Registers `delegate` to receive life cycle callbacks via this FlutterPluginAppLifecycleDelegate as long as it is alive.
`delegate` will only referenced weakly.
*/
- (void)addDelegate:(NSObject<FlutterPlugin>*)delegate;
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks.
- Returns: `NO` if any plugin vetoes application launch.
*/
- (BOOL)application:(UIApplication*)application
didFinishLaunchingWithOptions:(NSDictionary*)launchOptions;
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks.
*/
- (void)applicationDidBecomeActive:(UIApplication*)application;
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks.
*/
- (void)applicationWillResignActive:(UIApplication*)application;
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks.
*/
- (void)applicationDidEnterBackground:(UIApplication*)application;
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks.
*/
- (void)applicationWillEnterForeground:(UIApplication*)application;
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks.
*/
- (void)applicationWillTerminate:(UIApplication*)application;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
*/
- (void)application:(UIApplication*)application
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings;
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks.
*/
- (void)application:(UIApplication*)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken;
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks.
*/
- (void)application:(UIApplication*)application
didReceiveRemoteNotification:(NSDictionary*)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles
the request.
- Returns: `YES` if any plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application
openURL:(NSURL*)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id>*)options;
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles
the request.
- Returns: `YES` if any plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url;
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles
the request.
- Returns: `YES` if any plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application
openURL:(NSURL*)url
sourceApplication:(NSString*)sourceApplication
annotation:(id)annotation;
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks.
*/
- (void)application:(UIApplication*)application
performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem
completionHandler:(void (^)(BOOL succeeded))completionHandler
API_AVAILABLE(ios(9.0));
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles
the request.
- Returns: `YES` if any plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application
handleEventsForBackgroundURLSession:(nonnull NSString*)identifier
completionHandler:(nonnull void (^)(void))completionHandler;
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles
the request.
- Returns: `YES` if any plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application
performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
/**
Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles
the request.
- Returns: `YES` if any plugin handles the request.
*/
- (BOOL)application:(UIApplication*)application
continueUserActivity:(NSUserActivity*)userActivity
restorationHandler:(void (^)(NSArray*))restorationHandler;
@end
NS_ASSUME_NONNULL_END
#endif // FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_

View File

@ -1,29 +0,0 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLUTTERTEXTURE_H_
#define FLUTTER_FLUTTERTEXTURE_H_
#import <CoreMedia/CoreMedia.h>
#import <Foundation/Foundation.h>
#include "FlutterMacros.h"
NS_ASSUME_NONNULL_BEGIN
FLUTTER_EXPORT
@protocol FlutterTexture<NSObject>
- (CVPixelBufferRef _Nullable)copyPixelBuffer;
@end
FLUTTER_EXPORT
@protocol FlutterTextureRegistry<NSObject>
- (int64_t)registerTexture:(NSObject<FlutterTexture>*)texture;
- (void)textureFrameAvailable:(int64_t)textureId;
- (void)unregisterTexture:(int64_t)textureId;
@end
NS_ASSUME_NONNULL_END
#endif // FLUTTER_FLUTTERTEXTURE_H_

View File

@ -1,57 +0,0 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLUTTERVIEWCONTROLLER_H_
#define FLUTTER_FLUTTERVIEWCONTROLLER_H_
#import <UIKit/UIKit.h>
#include <sys/cdefs.h>
#include "FlutterBinaryMessenger.h"
#include "FlutterDartProject.h"
#include "FlutterMacros.h"
#include "FlutterPlugin.h"
#include "FlutterTexture.h"
FLUTTER_EXPORT
@interface FlutterViewController : UIViewController<FlutterBinaryMessenger, FlutterTextureRegistry, FlutterPluginRegistry>
- (instancetype)initWithProject:(FlutterDartProject*)project
nibName:(NSString*)nibNameOrNil
bundle:(NSBundle*)nibBundleOrNil NS_DESIGNATED_INITIALIZER;
- (void)handleStatusBarTouches:(UIEvent*)event;
/**
Returns the file name for the given asset.
The returned file name can be used to access the asset in the application's main bundle.
- Parameter asset: The name of the asset. The name can be hierarchical.
- Returns: the file name to be used for lookup in the main bundle.
*/
- (NSString*)lookupKeyForAsset:(NSString*)asset;
/**
Returns the file name for the given asset which originates from the specified package.
The returned file name can be used to access the asset in the application's main bundle.
- Parameters:
- asset: The name of the asset. The name can be hierarchical.
- package: The name of the package from which the asset originates.
- Returns: the file name to be used for lookup in the main bundle.
*/
- (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package;
/**
Sets the first route that the Flutter app shows. The default is "/".
- Parameter route: The name of the first route to show.
*/
- (void)setInitialRoute:(NSString*)route;
- (id<FlutterPluginRegistry>)pluginRegistry;
@end
#endif // FLUTTER_FLUTTERVIEWCONTROLLER_H_

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>Flutter</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Flutter</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
</dict>
</plist>

View File

@ -1,6 +0,0 @@
framework module Flutter {
umbrella header "Flutter.h"
export *
module * { export * }
}

View File

@ -1 +0,0 @@
#include "Generated.xcconfig"

View File

@ -1 +0,0 @@
{}

View File

@ -1 +0,0 @@
[]

File diff suppressed because it is too large Load Diff

View File

@ -1,438 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "<group>";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
);
sourceTree = "<group>";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
);
name = Products;
sourceTree = "<group>";
};
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
97C146F11CF9000F007C117D /* Supporting Files */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
);
path = Runner;
sourceTree = "<group>";
};
97C146F11CF9000F007C117D /* Supporting Files */ = {
isa = PBXGroup;
children = (
97C146F21CF9000F007C117D /* main.m */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0910;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
97C146EC1CF9000F007C117D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
97C146EA1CF9000F007C117D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
97C146F31CF9000F007C117D /* main.m in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C146FB1CF9000F007C117D /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.appleeducate.flutterSms;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.appleeducate.flutterSms;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,
97C147041CF9000F007C117D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147061CF9000F007C117D /* Debug */,
97C147071CF9000F007C117D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>

View File

@ -1,93 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>

View File

@ -1,6 +0,0 @@
#import <Flutter/Flutter.h>
#import <UIKit/UIKit.h>
@interface AppDelegate : FlutterAppDelegate
@end

View File

@ -1,13 +0,0 @@
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GeneratedPluginRegistrant registerWithRegistry:self];
// Override point for customization after application launch.
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end

View File

@ -1,122 +0,0 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -1,23 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 B

View File

@ -1,5 +0,0 @@
# Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
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.

View File

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
</resources>
</document>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Flutter View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>

View File

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>flutter_sms</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>

View File

@ -1,9 +0,0 @@
#import <Flutter/Flutter.h>
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char* argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

View File

@ -1 +0,0 @@
{"services":[]}

View File

@ -1,13 +1,27 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
class FlutterSms {
static const MethodChannel _channel =
const MethodChannel('flutter_sms');
static const MethodChannel _channel = const MethodChannel('flutter_sms');
static Future<String> get platformVersion async {
final String version = await _channel.invokeMethod('getPlatformVersion');
return version;
}
static Future<String> sendSMS({
@required String message,
@required List<String> recipients,
}) async {
var mapData = Map();
mapData["message"] = message;
mapData["recipients"] = recipients;
final String result = await _channel.invokeMethod('sendSMS', mapData);
String _log = "SMS Message: $message";
for (var person in recipients) _log += "\nSent: $person";
// final String result = _log;
return result;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
screenshots/android_mms.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
screenshots/android_sms.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
screenshots/ios_blank.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
screenshots/ios_mms.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
screenshots/ios_single.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
screenshots/ios_sms.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB