diff --git a/README.md b/README.md index d6128517..d81f9be1 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ npm start - [@nativescript/email](packages/email/README.md) - [@nativescript/facebook](packages/facebook/README.md) - [@nativescript/fingerprint-auth](packages/fingerprint-auth/README.md) +- [@nativescript/flutter](packages/flutter/README.md) - [@nativescript/geolocation](packages/geolocation/README.md) - [@nativescript/google-maps](packages/google-maps/README.md) - [@nativescript/google-signin](packages/google-signin/README.md) diff --git a/apps/demo-angular/package.json b/apps/demo-angular/package.json index d48f8d29..800e6bf5 100644 --- a/apps/demo-angular/package.json +++ b/apps/demo-angular/package.json @@ -20,6 +20,7 @@ "@nativescript/email": "file:../../dist/packages/email", "@nativescript/facebook": "file:../../dist/packages/facebook", "@nativescript/fingerprint-auth": "file:../../dist/packages/fingerprint-auth", + "@nativescript/flutter": "file:../../dist/packages/flutter", "@nativescript/geolocation": "file:../../dist/packages/geolocation", "@nativescript/google-maps": "file:../../dist/packages/google-maps", "@nativescript/google-signin": "file:../../dist/packages/google-signin", diff --git a/apps/demo-angular/src/app-routing.module.ts b/apps/demo-angular/src/app-routing.module.ts index cefc7451..a9fbd57b 100644 --- a/apps/demo-angular/src/app-routing.module.ts +++ b/apps/demo-angular/src/app-routing.module.ts @@ -24,13 +24,14 @@ const routes: Routes = [ { path: 'email', loadChildren: () => import('./plugin-demos/email.module').then((m) => m.EmailModule) }, { path: 'facebook', loadChildren: () => import('./plugin-demos/facebook.module').then((m) => m.FacebookModule) }, { path: 'fingerprint-auth', loadChildren: () => import('./plugin-demos/fingerprint-auth.module').then((m) => m.FingerprintAuthModule) }, + { path: 'flutter', loadChildren: () => import('./plugin-demos/flutter.module').then((m) => m.FlutterModule) }, { path: 'geolocation', loadChildren: () => import('./plugin-demos/geolocation.module').then((m) => m.GeolocationModule) }, { path: 'google-maps', loadChildren: () => import('./plugin-demos/google-maps.module').then((m) => m.GoogleMapsModule) }, { path: 'google-signin', loadChildren: () => import('./plugin-demos/google-signin.module').then((m) => m.GoogleSigninModule) }, { path: 'haptics', loadChildren: () => import('./plugin-demos/haptics.module').then((m) => m.HapticsModule) }, { path: 'imagepicker', loadChildren: () => import('./plugin-demos/imagepicker.module').then((m) => m.ImagepickerModule) }, { path: 'ionic-portals', loadChildren: () => import('./plugin-demos/ionic-portals.module').then((m) => m.IonicPortalsModule) }, - { path: 'ios-security', loadChildren: () => import('./plugin-demos/ios-security.module').then((m) => m.IosSecurityModule) }, + { path: 'ios-security', loadChildren: () => import('./plugin-demos/ios-security.module').then((m) => m.IOSSecurityModule) }, { path: 'iqkeyboardmanager', loadChildren: () => import('./plugin-demos/iqkeyboardmanager.module').then((m) => m.IqkeyboardmanagerModule) }, { path: 'jetpack-compose', loadChildren: () => import('./plugin-demos/jetpack-compose.module').then((m) => m.JetpackComposeModule) }, { path: 'local-notifications', loadChildren: () => import('./plugin-demos/local-notifications.module').then((m) => m.LocalNotificationsModule) }, diff --git a/apps/demo-angular/src/home.component.ts b/apps/demo-angular/src/home.component.ts index 863f9cb6..b6c71d17 100644 --- a/apps/demo-angular/src/home.component.ts +++ b/apps/demo-angular/src/home.component.ts @@ -57,6 +57,9 @@ export class HomeComponent { { name: 'fingerprint-auth', }, + { + name: 'flutter', + }, { name: 'geolocation', }, diff --git a/apps/demo-angular/src/plugin-demos/flutter.component.html b/apps/demo-angular/src/plugin-demos/flutter.component.html new file mode 100644 index 00000000..58a0940b --- /dev/null +++ b/apps/demo-angular/src/plugin-demos/flutter.component.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/apps/demo-angular/src/plugin-demos/flutter.component.ts b/apps/demo-angular/src/plugin-demos/flutter.component.ts new file mode 100644 index 00000000..95732312 --- /dev/null +++ b/apps/demo-angular/src/plugin-demos/flutter.component.ts @@ -0,0 +1,17 @@ +import { Component, NgZone } from '@angular/core'; +import { DemoSharedFlutter } from '@demo/shared'; +import {} from '@nativescript/flutter'; + +@Component({ + selector: 'demo-flutter', + templateUrl: 'flutter.component.html', +}) +export class FlutterComponent { + demoShared: DemoSharedFlutter; + + constructor(private _ngZone: NgZone) {} + + ngOnInit() { + this.demoShared = new DemoSharedFlutter(); + } +} diff --git a/apps/demo-angular/src/plugin-demos/flutter.module.ts b/apps/demo-angular/src/plugin-demos/flutter.module.ts new file mode 100644 index 00000000..8a1e8db2 --- /dev/null +++ b/apps/demo-angular/src/plugin-demos/flutter.module.ts @@ -0,0 +1,10 @@ +import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; +import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular'; +import { FlutterComponent } from './flutter.component'; + +@NgModule({ + imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: FlutterComponent }])], + declarations: [FlutterComponent], + schemas: [NO_ERRORS_SCHEMA], +}) +export class FlutterModule {} diff --git a/apps/demo/flutter_module/.gitignore b/apps/demo/flutter_module/.gitignore new file mode 100644 index 00000000..9141595f --- /dev/null +++ b/apps/demo/flutter_module/.gitignore @@ -0,0 +1,50 @@ +.DS_Store +.dart_tool/ + +.packages +.pub/ + +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +migrate_working_dir/ + +*.swp +profile + +DerivedData/ + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +build/ +.android/ +.ios/ +.flutter-plugins +.flutter-plugins-dependencies + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json diff --git a/apps/demo/flutter_module/.metadata b/apps/demo/flutter_module/.metadata new file mode 100644 index 00000000..b4666993 --- /dev/null +++ b/apps/demo/flutter_module/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + channel: stable + +project_type: module diff --git a/apps/demo/flutter_module/README.md b/apps/demo/flutter_module/README.md new file mode 100644 index 00000000..6ee3cc24 --- /dev/null +++ b/apps/demo/flutter_module/README.md @@ -0,0 +1,11 @@ +# flutter_module + +A new Flutter module project. + +## Getting Started + +For help getting started with Flutter development, view the online +[documentation](https://flutter.dev/). + +For instructions integrating Flutter modules to your existing applications, +see the [add-to-app documentation](https://flutter.dev/docs/development/add-to-app). diff --git a/apps/demo/flutter_module/analysis_options.yaml b/apps/demo/flutter_module/analysis_options.yaml new file mode 100644 index 00000000..a5744c1c --- /dev/null +++ b/apps/demo/flutter_module/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/apps/demo/flutter_module/flutter_module.iml b/apps/demo/flutter_module/flutter_module.iml new file mode 100644 index 00000000..f66303d5 --- /dev/null +++ b/apps/demo/flutter_module/flutter_module.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/apps/demo/flutter_module/flutter_module_android.iml b/apps/demo/flutter_module/flutter_module_android.iml new file mode 100644 index 00000000..6fa7b635 --- /dev/null +++ b/apps/demo/flutter_module/flutter_module_android.iml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + diff --git a/apps/demo/flutter_module/lib/main.dart b/apps/demo/flutter_module/lib/main.dart new file mode 100644 index 00000000..5528fec9 --- /dev/null +++ b/apps/demo/flutter_module/lib/main.dart @@ -0,0 +1,117 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +void main() => runApp(const MyApp()); + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + // This widget is the root of your application. + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + theme: ThemeData( + // This is the theme of your application. + // + // Try running your application with "flutter run". You'll see the + // application has a blue toolbar. Then, without quitting the app, try + // changing the primarySwatch below to Colors.green and then invoke + // "hot reload" (press "r" in the console where you ran "flutter run", + // or press Run > Flutter Hot Reload in a Flutter IDE). Notice that the + // counter didn't reset back to zero; the application is not restarted. + primarySwatch: Colors.blue, + ), + home: const MyHomePage(title: 'Flutter Demo Home Page'), + ); + } +} + +class MyHomePage extends StatefulWidget { + const MyHomePage({super.key, required this.title}); + + // This widget is the home page of your application. It is stateful, meaning + // that it has a State object (defined below) that contains fields that affect + // how it looks. + + // This class is the configuration for the state. It holds the values (in this + // case the title) provided by the parent (in this case the App widget) and + // used by the build method of the State. Fields in a Widget subclass are + // always marked "final". + + final String title; + + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + int _counter = 0; + MethodChannel platform = const MethodChannel("nativescript"); + void _incrementCounter() async { + int level = await platform.invokeMethod("getBatteryLevel"); + + print("level $level"); + + setState(() { + // This call to setState tells the Flutter framework that something has + // changed in this State, which causes it to rerun the build method below + // so that the display can reflect the updated values. If we changed + // _counter without calling setState(), then the build method would not be + // called again, and so nothing would appear to happen. + _counter++; + }); + } + + @override + Widget build(BuildContext context) { + // This method is rerun every time setState is called, for instance as done + // by the _incrementCounter method above. + // + // The Flutter framework has been optimized to make rerunning build methods + // fast, so that you can just rebuild anything that needs updating rather + // than having to individually change instances of widgets. + return Scaffold( + appBar: AppBar( + // Here we take the value from the MyHomePage object that was created by + // the App.build method, and use it to set our appbar title. + title: Text(widget.title), + ), + body: Center( + // Center is a layout widget. It takes a single child and positions it + // in the middle of the parent. + child: Column( + // Column is also a layout widget. It takes a list of children and + // arranges them vertically. By default, it sizes itself to fit its + // children horizontally, and tries to be as tall as its parent. + // + // Invoke "debug painting" (press "p" in the console, choose the + // "Toggle Debug Paint" action from the Flutter Inspector in Android + // Studio, or the "Toggle Debug Paint" command in Visual Studio Code) + // to see the wireframe for each widget. + // + // Column has various properties to control how it sizes itself and + // how it positions its children. Here we use mainAxisAlignment to + // center the children vertically; the main axis here is the vertical + // axis because Columns are vertical (the cross axis would be + // horizontal). + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + 'You have pushed the button this many times:', + ), + Text( + '$_counter', + style: Theme.of(context).textTheme.headlineMedium, + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: const Icon(Icons.add), + ), // This trailing comma makes auto-formatting nicer for build methods. + ); + } +} diff --git a/apps/demo/flutter_module/pubspec.lock b/apps/demo/flutter_module/pubspec.lock new file mode 100644 index 00000000..b2cb69de --- /dev/null +++ b/apps/demo/flutter_module/pubspec.lock @@ -0,0 +1,188 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" + source: hosted + version: "2.10.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" + source: hosted + version: "1.2.1" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" + source: hosted + version: "1.17.0" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" + source: hosted + version: "1.0.5" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" + source: hosted + version: "2.0.1" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" + source: hosted + version: "0.6.5" + lints: + dependency: transitive + description: + name: lints + sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" + source: hosted + version: "0.12.13" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" + source: hosted + version: "1.8.0" + path: + dependency: transitive + description: + name: path + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" + source: hosted + version: "1.8.2" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" + source: hosted + version: "0.4.16" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" +sdks: + dart: ">=2.19.6 <3.0.0" diff --git a/apps/demo/flutter_module/pubspec.yaml b/apps/demo/flutter_module/pubspec.yaml new file mode 100644 index 00000000..24705b0a --- /dev/null +++ b/apps/demo/flutter_module/pubspec.yaml @@ -0,0 +1,87 @@ +name: flutter_module +description: A new Flutter module project. + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# +# This version is used _only_ for the Runner app, which is used if you just do +# a `flutter run` or a `flutter make-host-app-editable`. It has no impact +# on any other native host app that you embed your Flutter project into. +version: 1.0.0+1 + +environment: + sdk: '>=2.19.6 <3.0.0' + +dependencies: + flutter: + sdk: flutter + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +flutter: + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add Flutter specific assets to your application, add an assets section, + # like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add Flutter specific custom fonts to your application, add a fonts + # section here, in this "flutter" section. Each entry in this list should + # have a "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages + + + # This section identifies your Flutter project as a module meant for + # embedding in a native host app. These identifiers should _not_ ordinarily + # be changed after generation - they are used to ensure that the tooling can + # maintain consistency when adding or modifying assets and plugins. + # They also do not have any bearing on your native host application's + # identifiers, which may be completely independent or the same as these. + module: + androidX: true + androidPackage: com.example.flutter_module + iosBundleIdentifier: com.example.flutterModule diff --git a/apps/demo/flutter_module/test/widget_test.dart b/apps/demo/flutter_module/test/widget_test.dart new file mode 100644 index 00000000..396d6965 --- /dev/null +++ b/apps/demo/flutter_module/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:flutter_module/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/apps/demo/nativescript.config.ts b/apps/demo/nativescript.config.ts index e18221d6..6c56a679 100644 --- a/apps/demo/nativescript.config.ts +++ b/apps/demo/nativescript.config.ts @@ -1,7 +1,7 @@ import { NativeScriptConfig } from '@nativescript/core'; export default { - id: 'org.nativescript.plugindemo', + id: 'org.nativescript.plugindemotest', appResourcesPath: '../../tools/assets/App_Resources', android: { v8Flags: '--expose_gc', @@ -9,12 +9,12 @@ export default { }, appPath: 'src', cli: { - packageManager: 'npm' + packageManager: 'npm', }, hooks: [ { - type: 'before-prepare', - script: '../../tools/scripts/before-prepare.js', - } - ], + type: 'before-prepare', + script: '../../tools/scripts/before-prepare.js', + }, + ], } as NativeScriptConfig; diff --git a/apps/demo/package.json b/apps/demo/package.json index c2110ae2..c08a6c22 100644 --- a/apps/demo/package.json +++ b/apps/demo/package.json @@ -23,6 +23,7 @@ "@nativescript/email": "file:../../packages/email", "@nativescript/facebook": "file:../../packages/facebook", "@nativescript/fingerprint-auth": "file:../../packages/fingerprint-auth", + "@nativescript/flutter": "file:../../packages/flutter", "@nativescript/geolocation": "file:../../packages/geolocation", "@nativescript/google-maps": "file:../../packages/google-maps", "@nativescript/google-signin": "file:../../packages/google-signin", diff --git a/apps/demo/src/app.ts b/apps/demo/src/app.ts index 41103c1c..336021c1 100644 --- a/apps/demo/src/app.ts +++ b/apps/demo/src/app.ts @@ -1,5 +1,6 @@ import { Application } from '@nativescript/core'; - +import { FlutterDelegate, init } from '@nativescript/flutter'; +init(); // uncomment to test local notifications // import "@nativescript/local-notifications"; @@ -24,4 +25,8 @@ import { Application } from '@nativescript/core'; // IonicPortalManager.register(''); // }); +if (global.isIOS) { + Application.ios.delegate = FlutterDelegate; +} + Application.run({ moduleName: 'app-root' }); diff --git a/apps/demo/src/main-page.xml b/apps/demo/src/main-page.xml index f68418ec..f6f7d61b 100644 --- a/apps/demo/src/main-page.xml +++ b/apps/demo/src/main-page.xml @@ -22,6 +22,7 @@