Giter Site home page Giter Site logo

flutter-apns's Introduction

apns

⛔️ DEPRECATED ⛔️

This package is not longer maintained. Please write message or GitHub issue if you want to take it over and end deprecated state.

Plugin to implement APNS push notifications on iOS and Firebase on Android.

Why this plugin was made?

Currently, the only available push notification plugin is firebase_messaging. This means that, even on iOS, you will need to setup firebase and communicate with Google to send push notification. This plugin solves the problem by providing native APNS implementation while leaving configured Firebase for Android.

Usage

  1. Configure firebase on Android according to instructions: https://pub.dartlang.org/packages/firebase_messaging.

  2. On iOS, make sure you have correctly configured your app to support push notifications, and that you have generated certificate/token for sending pushes. For more infos see section How to run example app on iOS

  3. Add the following lines to the didFinishLaunchingWithOptions method in the AppDelegate.m/AppDelegate.swift file of your iOS project

Objective-C:

if (@available(iOS 10.0, *)) {
  [UNUserNotificationCenter currentNotificationCenter].delegate = (id<UNUserNotificationCenterDelegate>) self;
}

Swift:

if #available(iOS 10.0, *) {
  UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
}
  1. Add flutter_apns as a dependency in your pubspec.yaml file.
  2. Using createPushConnector() method, configure push service according to your needs. PushConnector closely resembles FirebaseMessaging, so Firebase samples may be useful during implementation. You should create the connector as soon as possible to get the onLaunch callback working on closed app launch.
import 'package:flutter_apns/apns.dart';

final connector = createPushConnector();
connector.configure(
    onLaunch: _onLaunch,
    onResume: _onResume,
    onMessage: _onMessage,
);
connector.requestNotificationPermissions()
  1. Build on device and test your solution using Firebase Console (Android) and CURL (iOS, see How to run example app on iOS).

Additional APNS features:

Displaying notification while in foreground

final connector = createPushConnector();
if (connector is ApnsPushConnector) {
  connector.shouldPresent = (x) => Future.value(true);
}

Handling predefined actions

Firstly, configure supported actions:

final connector = createPushConnector();
if (connector is ApnsPushConnector) {
  connector.setNotificationCategories([
    UNNotificationCategory(
      identifier: 'MEETING_INVITATION',
      actions: [
        UNNotificationAction(
          identifier: 'ACCEPT_ACTION',
          title: 'Accept',
          options: [],
        ),
        UNNotificationAction(
          identifier: 'DECLINE_ACTION',
          title: 'Decline',
          options: [],
        ),
      ],
      intentIdentifiers: [],
      options: [],
    ),
  ]);
}

Then, handle possible actions in your push handler:

Future<dynamic> onPush(String name, RemoteMessage payload) {
  final action = UNNotificationAction.getIdentifier(payload.data);

  if (action == 'MEETING_INVITATION') {
    // do something
  }

  return Future.value(true);
}

Note: if user clickes your notification while app is in the background, push will be delivered through onResume without actually waking up the app. Make sure your handling of given action is quick and error free, as execution time in for apps running in the background is very limited.

Check the example project for fully working code.

Enabling FirebaseCore

If you want to use firebase, but not firebase messaging, add this configuration entry in your Info.plist (to avoid MissingPluginException):

<key>flutter_apns.disable_firebase_core</key>
<false/>

flutter_apns_only - APNS without firebase

If only care about apns - use flutter_apns_only plugin. It does not depend on firebase. To ensure no swizzling (which is needed by original plugin to disable firebase) takes place, add this configuration entry in your Info.plist:

<key>flutter_apns.disable_swizzling</key>
<true/>

Troubleshooting

  1. Ensure that you are testing on actual device. NOTE: this may not be needed from 11.4: https://ohmyswift.com/blog/2020/02/13/simulating-remote-push-notifications-in-a-simulator/
  2. If onToken method is not being called, add error logging to your AppDelegate, see code below.
  3. Open Console app for macOS, connect your device, and run your app. Search for "PUSH registration failed" string in logs. The error message will tell you what was wrong.

swift

import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }

  func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
     NSLog("PUSH registration failed: \(error)")
  }
}

objc

#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];
}

-(void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
    NSLog(@"%@", error);
}

@end

How to run example app on iOS

Setting up push notifications on iOS can be tricky since there is no way to permit Apple Push Notification Service (APNS) which requires a complicated certificate setup. The following guide describes a step by step approach to send push notifications from your Mac to an iPhone utilizing the example app of this package. This guide only describes debug environment setup.

  1. Open example ios folder with Xcode
  2. Select Runner -> Signing & Capabilities
  3. Select your development team and add a globally unique bundle identifier. The one on the picture is already occupied:
  4. Go to https://developer.apple.com/account/resources/identifiers/list/bundleId and press on the plus button
  5. Select "App IDs" and press continue
  6. Select type "App"
  7. Select "App ID Prefix" which should be same as "Team ID"
  8. Enter description and bundle ID. The latter one needs to be the same as the bundle ID specified in 3.
  9. Select push notification capability
  10. Press on "Continue" and then on "Register"
  11. Go to https://developer.apple.com/account/resources/certificates and add a new certificate by pressing on the plus-button.
  12. Select 'Apple Push Notification service SSL (Sandbox & Production)'
  13. Select the app ID that you hav defined in point 4.-10.
  14. Select a Certificate Signing Request (CSR) file. See https://help.apple.com/developer-account/#/devbfa00fef7 on how to create this certificate
  15. When having finished, download the newly created Apple Push Services certificate
  16. Add certificate to your local keychain by opening the newly downloaded file
  17. Press on "login" on the upper left corner of your keychain window and select the tab "My Certificates"
  18. Right click on the Apple-Push-Services-certificate and export it as .p12-file
  19. Convert p12-file to pem-file by following command. Please consider that "flutterApns" needs to be replaced by your respective certificate name.
    More info
    openssl pkcs12 -in flutterApns.p12 -out flutterApns.pem -nodes -clcerts
    
  20. Start example app on physical iPhone device from Xcode or your favorite IDE.
  21. Device token gets automatically printed when application was able to retrieve push token from APNS. This happens after accepting notification permission prompt.
  22. Send the following CURL from you development Mac. You can execute CURLs by copy-pasting them into Terminal and hit enter.
    More info
    curl -v \
    -d '{"aps":{"alert":"<your_message>","badge":2}}' \
    -H "apns-topic: <bundle_identifier_of_registered_app>" \
    -H "apns-priority: 10" \
    --http2 \
    --cert <file_path_to_downloaded_signed_and_converted_certificate>.pem \
    https://api.development.push.apple.com/3/device/<device_token>
    
  23. A push notification does appear if the example app is in background.

When not utilizing the example app, you need to additionally setup push notification capability inside Xcode and add the code mentioned in usage.

flutter-apns's People

Contributors

acalatrava avatar asaarnak avatar cemozerr avatar christofkost avatar danielkono avatar evgenij-lupiter avatar fbcouch avatar hugoheneault avatar lordgreg avatar stefanjauker avatar twwd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter-apns's Issues

onMessage does not get called on iOS

onMessage does not get called on iOS.

I've got notifications set up correctly and working. I'm using onResume and onLaunch well to open up a specific route in my application, yet, I just want to print something or add the data I receive on onMessage, and nothing happens.

MissingPluginException in iOS

iOS is giving following exception while initialising firebase,

[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core)
#0      MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:157
<asynchronous suspension>
#1      MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:332
#2      MethodChannel.invokeListMethod
package:flutter/…/services/platform_channel.dart:345
#3      MethodChannelFirebase._initializeCore
package:firebase_core_platform_interface/…/method_channel/method_channel_firebase.dart:30
#4      MethodChannelFirebase.initializeApp
package:firebase_core_platform_interface/…/method_channel/method_channel_firebase.dart:75
#5      Firebase.initializeApp
package:firebase_core/src/firebase.dart:43
#6      main
package:Rastrack/main.dart:260
#7      _rootRunUnary (dart:async/zone.dart:1198:47)
#8      _CustomZone.runUnary (dart:async/zone.dart:11<…>

Pub versions:
flutter_apns: ^1.4.1
firebase_core: ^0.7.0

Cannot get any iOS app to work

Hi so i saw this plugin a few days ago and decided to test it for iOS. The following is an overview of my project:

  1. I used the example project in the repo and changed the pubspec.yaml to use dependency: flutter_apns: ^1.0.5
  2. I changed the bundle id, and team id using xcode to my values,
  3. I enabled push notifications, background fetch and remote notifications in xcode
  4. I created the online configuration by creating certificates for push then downloaded and generated p12
  5. On running the app, the token is never generated (print('Token ${connector.token.value}');) is never called

What im i doing wrong. Help.
Thanks in advance.

EDIT:
I get this error in XCode
"invalid capability (0x14) "Unable to insert COPY_SEND""

No push notifications when an app is in foreground and no callbacks onMessage

Hello,

I'm having the issue with push notifications: no notifications when my app is in foreground (also no callbacks onMessage).
Also onPush is never called, but my app receives push notifications when it's in background.

I'm using flutter_apns: 1.4.1, Flutter 2.0.0

Here is the code I use (it's 99% from the example):

void main() {
...
  WidgetsFlutterBinding.ensureInitialized();
...
}

Future<void> initPush() async {
    final connector = createPushConnector();
    if (connector is ApnsPushConnector) {
      connector.shouldPresent = (x) => Future.value(true);
    }
    connector.configure(
      onLaunch: (data) => onPush('onLaunch', data),
      onResume: (data) => onPush('onResume', data),
      onMessage: (data) => onPush('onMessage', data),
      onBackgroundMessage: _onBackgroundMessage,
    );
    connector.token.addListener(() async {
      print('${connector.token.value}');
     
    });
    connector.requestNotificationPermissions();
}


  Future<dynamic> onPush(String name, Map<String, dynamic> payload) {

    print('$payload');
    final action = UNNotificationAction.getIdentifier(payload);

    if (action == 'MEETING_INVITATION') {
      print('MEETING_INVITATION');
    }

    return Future.value(true);
  }

  Future<dynamic> _onBackgroundMessage(Map<String, dynamic> data) =>
      onPush('onBackgroundMessage', data);

Any ideas what can be wrong?

connector.token not working

I don't understand why, but it looks like i can't get the Apns Token from the connector.token.
Every time i tried this on a IOS simulator it print nothing .
And even if i tried it on a real IOS device, it's still not working.

  @override
  void initState() {
    super.initState();

  getIOSPermission() {
    _firebaseMessaging.requestNotificationPermissions(
        IosNotificationSettings(alert: true, badge: true, sound: true));
    _firebaseMessaging.onIosSettingsRegistered.listen((settings) {
      print("Settings registered:$settings");
    });
  }
    if (Platform.isIOS) {
      getIOSPermission();
      connector.requestNotificationPermissions();
    }



     connector.token.addListener(() {
            print('Apns Token ${connector.token.value}');
            usersRef.document(firebaseUser.uid).updateData(
                {"IOsToken": connector.token.value});
      })

_firebaseMessaging.configure(
      onLaunch: onPush,
      onResume: onPush,
      onMessage: onPush,
      onBackgroundMessage: onBackgroundPush,
    );
 }

ive enable all (enable Push Notifications and Background Modes, and enable Background fetch and Remote notifications under Background Modes.) and followed all the firebase messaging instruction and APNS IOs configure steps.
I'm not using connector .config method, is it a problem ?
Any help would be nice,

latest firebase_messaging plugin broken with android on flutter 1.7

I believe this is related to this issue, firebase/flutterfire#188 just recently( the 19th ), firebase_messaging was upgraded, however, on android using Flutter 1.7 ( not the latest upgrade 1.9 ). I receive this error using flutter-apns 1.0.2.

error: method findAppBundlePath in class FlutterMain cannot be applied to given types;
String appBundlePath = FlutterMain.findAppBundlePath();
^
required: Context
found: no arguments
reason: actual and formal argument lists differ in length
1 error
Finished with error: Gradle task assembleDebug failed with exit code 1

Reverting flutter-apns to 1.0.1 seems to work for android, but does not seem to compile properly on iOS.

We are not ready to update to flutter 1.9( if this is truly the issue ), changing the firebase_messaging include in flutter-apns pubspec.yaml to be "5.1.3" rather than "^5.1.3" seems to fix this issue when I build flutter-apns as a local plugin.

Versão 1.4.1 not working onLaunch app closed

I did the whole process and it works perfectly, onMessage, onResume.

onLaunch is not called when the app is closed, see my implementation:

import 'package:flutter_apns/apns.dart';

import '../utilities/notifications.dart';

class PushNotificationService extends GetxService {
String token;
bool isAction = false;

Future initNotification() async {
print('PUSH - INICIALIZADO');
final connector = createPushConnector()

connector.configure(
  onMessage: (Map<String, dynamic> message) {
    print('PUSH - onMessage');
    String title, body, action;

    if (connector is ApnsPushConnector) {
      title = message['aps']['alert']['title'] ?? '';
      body = message['aps']['alert']['body'] ?? '';
      action = message['aps']['action'] ?? '';
    } else {
      title = message['data']['title'] ?? '';
      body = message['data']['body'] ?? '';
      action = message['data']['action'];
    }
      
    }
    return Future.value();
  },
  onBackgroundMessage: (Map<String, dynamic> message) async {
    print('PUSH - onBackgroundMessage');
    String action;
    if (connector is ApnsPushConnector) {
      action = message['aps']['action'] ?? '';
    } else {
      action = message['data']['action'] ?? '';
    }
  },
  onLaunch: (Map<String, dynamic> message) async {
    print('PUSH - onLaunch');
    String action;
    if (connector is ApnsPushConnector) {
      action = message['aps']['action'] ?? '';
    } else {
      action = message['data']['action'] ?? '';
    }
  },
  onResume: (Map<String, dynamic> message) async {
    print('PUSH - onResume');
    String action;
    if (connector is ApnsPushConnector) {
      action = message['aps']['action'] ?? '';
    } else {
      action = message['data']['action'] ?? '';
    }
      return Future.value();
  },
);

connector.token.addListener(() {
  try {
    token = connector.token.value;
    print('TOKEN: $token');
  } catch (e) {}
});

connector.requestNotificationPermissions();

if (connector is ApnsPushConnector) {
  connector.shouldPresent = (Map<String, dynamic> message) {
    return Future.value(false);
  };
}

token = connector.token?.value;

}
}

Dependency conflict with latest firebase_messaging

Because flutter_apns 1.1.0 depends on firebase_messaging ^6.0.9 and no versions of flutter_apns match >1.1.0 <2.0.0, flutter_apns ^1.1.0 requires firebase_messaging ^6.0.9.
So, because app depends on both firebase_messaging ^7.0.0 and flutter_apns ^1.1.0, version solving failed.

Encoding of the APN token changed from uppercase to lowercase, resulting in duplicate push-notifications

We tracked down reports from users that received duplicate push-notifications on iOS from our notification-service. It turned out, we received differently formatted tokens from this library recently.

Looks like this change is the culprit:
4581b17c59b893853af91e6799dedf3b162695b9 (FlutterApnsPlugin.m :: stringWithDeviceToken)
(hexString changed while it got ported from obj-c to swift)

We stored them as is, without further deduplication in the assumption they should be treated as opaque. Obviously, this assumption was wrong - at least for iOS.

I think what's missing here ist:

  • unit-tests for for formatting of hexString, so it doesn't change again accidentally and is always hex-encoded
  • improved documentation that users have to perform hex-based-deduplication of the APN token to mitigate this problem

Adding this plugin results in MissingPluginException for Firebase Core

Adding this plugin to the pubspec.yaml (without even using or importing it anywhere), results in the exception below:

[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157:7)
<asynchronous suspension>
#1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
#2      MethodChannel.invokeListMethod (package:flutter/src/services/platform_channel.dart:345:41)
#3      MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:30:36)
#4      MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:75:13)
#5      Firebase.initializeApp (package:firebase_core/src/firebase.dart:43:25)
#6      main (package:mobile/main.dart:14:18)
#7      _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:231:25)
#8      _rootRun (d<…>

In this project where the error occurs, I also import and use firebase_core and firebase_auth. The error occurs at the main() function in main.dart where I have the code below before calling the runApp() method on my app.

  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(); // <-- Error occurs here

I've tried your 1.4.0, 1.3.1, 1.3.0 and 1.0.5 releases to remedy the issue, and even created a new flutter project with the same lib/ and pubspec.yaml to no avail.

The issue occurs with iOS, haven't tried with Android.

connector.token listener not called

Hey, I'm not getting any value back on the connector.token listener.
Currently on version 1.0.4 of the library and iOS 13.1.2 (physical device).
I've tried with the example app as well and I'm never getting a token back.

Update to firebase_messaging version to 9.0.0

I've created a fork of this plugin to update the firebase_messaging version to 9.0.0, as there are breaking changes compared to the version 7.0.0. I've updated the code accordingly. Please check the pull request.

Support mutable-content flag in APNS notifications to change displayed notification content

This is a feature request. I would like to be able to change the displayed content of a push notification as mentioned in this article:

https://developer.apple.com/documentation/usernotifications/modifying_content_in_newly_delivered_notifications

This becomes necessary if you receive encrypted messages or if the message only contains a technical message id and the client needs to load the actual message content in a subsequent step. It would be great if one could register a Flutter callback function (similar to onbackgroundMessage from firebase_messaging) that is called when a push notification is received. The function would return the content that should be displayed in the notification instead of the original data in the notification dictionary.

Add Actions support

i'm going to fork and add the actions buttons for the library, have you already considered this feature?

failed to run in Android

i got this message when trying to run my app in android , and when remove the plugin the app worked , this's the error :


> File '/myapp/build/apns_flutter/intermediates/local_only_symbol_list/debug/R-def.txt' specified for property 'localResourcesFile' does not exist.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)


README.md for iOS is probably wrong

I added code below to AppDelegate.swift following README.md.

UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate

Then I found that connector.configure(~) method didn't be called.
When I deleted it from AppDelegate.swift, connector.configure was called.

So I think there may be mistake in README.md.

Notification handlers never called

First off: Thank you for this plugin!

I am trying to use notifications on iOS and Android (via APNs and FCM), which I publish from Amazon AWS. When the app is running in the background (or is terminated), the notification pops in, which opens the app when I tap it. However, on iOS, none of the callback functions are ever called.

In the initState function of my main widget, I initialize the PushConnector as _messaging. I then try to set the callback handlers, which does not work (on iOS).

_messaging.configure(
      onMessage: (Map<String, dynamic> message) async {
        print("onMessage: $message");
        // further process message content
      },
      onBackgroundMessage: myBackgroundMessageHandler,
      onLaunch: (Map<String, dynamic> message) async {
        print("onLaunch: $message");
        // further process message content
      },
      onResume: (Map<String, dynamic> message) async {
        print("onResume: $message");
        // further process message content
      },
    );

EDIT: myBackgroundMessageHandler also does the same print, but the output is never shown either.

If anyone has any clue what could be causing this behaviour, I would be very grateful.

Not compatible with firebase_core: 0.7.0

flutter-apns has intrinsic dependency on firebase_messaging^7.0.0.
And firebase_messaging^7.0.0 doesn't allow for the app to be compiled with firebase_core: 0.7.0.

Pub get error log:

Because firebase_messaging >=7.0.0 <7.0.3 depends on firebase_core ^0.5.0 and no versions of firebase_messaging match >7.0.3 <8.0.0, firebase_messaging >=7.0.0 <7.0.3-∞ or >7.0.3 <8.0.0 requires firebase_core ^0.5.0.
And because firebase_messaging 7.0.3 depends on firebase_core ^0.5.0+1, firebase_messaging ^7.0.0 requires firebase_core ^0.5.0.
Because no versions of flutter_apns match >1.4.1 <2.0.0 and flutter_apns 1.4.1 depends on firebase_messaging ^7.0.0, flutter_apns ^1.4.1 requires firebase_messaging ^7.0.0.
Thus, flutter_apns ^1.4.1 requires firebase_core ^0.5.0.
So, because mymilkman depends on both firebase_core ^0.7.0 and flutter_apns ^1.4.1, version solving failed.
pub get failed (1; So, because mymilkman depends on both firebase_core ^0.7.0 and flutter_apns ^1.4.1, version solving failed.)

connector.token.addListener never call

I'm using Flutter beta: v1.24.0-10.2.pre. Seems like addListener never call and never get token. I already add the log error in AppDelegate.swift but still not get any error from console log application. Note that I'm testing on real device.

Duplicate event on IOS

It's look like the onResume and onLaunch is duplicate on IOS. it trigger both when app is terminated.
APNS version : latest
IOS Version : 13.5.1

-Flutter doctor

`[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.4 19E258a, locale en-US)
• Flutter version 1.20.4 at /Applications/AndroidProject/flutter
• Framework revision fba99f6cf9 (3 weeks ago), 2020-09-14 15:32:52 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/apple/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = /Users/apple/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
✗ Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0.1, Build version 12A7300
• CocoaPods version 1.9.3

[✓] Android Studio
• Android Studio at /Applications/Android Studio 4.1 Preview.app/Contents
• Flutter plugin version 45.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
`

Unable to get firebase token on Android

connector.token.addListener((){ print('Token ${connector.token.value}); });

Returns nothing
Using flutter_apns: ^1.1.0
Pubspec.lock has firebase_messaging: 6.0.13

Example does not start

Hi, I cloned this repository but it won't run for some reason, please help.

Pod install is not working either

P.s. This may be due to the fact that I have a MacBook with chip m1

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
 lib/main.dart
CocoaPods' output:
↳
      Preparing
    Analyzing dependencies
    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
    Finding Podfile changes
      - Flutter
      - firebase_core
      - firebase_messaging
      - flutter_apns
      - flutter_local_notifications
      - path_provider
    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
    firebase_core: Using Firebase SDK version '6.26.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_messaging` from `.symlinks/plugins/firebase_messaging/ios`
    firebase_messaging: Using Firebase SDK version '6.26.0' defined in 'firebase_core'
    -> Fetching podspec for `flutter_apns` from `.symlinks/plugins/flutter_apns/ios`
    -> Fetching podspec for `flutter_local_notifications` from `.symlinks/plugins/flutter_local_notifications/ios`
    -> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_0_3_5.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/7.3.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/6.26.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_8_b_d.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/8/b/d/FirebaseCore/7.3.0/FirebaseCore.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/6.26.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
    ――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
    ### Command
    ```
    /usr/local/bin/pod install --verbose
    ```
    ### Report
    * What did you do?
    * What did you expect to happen?
    * What happened instead?
    ### Stack
    ```
       CocoaPods : 1.10.0
            Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
        RubyGems : 3.0.3
            Host : macOS 11.1 (20C69)
           Xcode : 12.3 (12C33)
             Git : git version 2.24.3 (Apple Git-128)
    Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
    Repositories : master - git - https://github.com/CocoaPods/Specs.git @ 46723fe3a20b5da6a2bf5d170f680690d106c0dd
                   trunk - CDN - https://cdn.cocoapods.org/
    ```
    ### Plugins
    ```
    cocoapods-deintegrate : 1.0.4
    cocoapods-plugins     : 1.0.0
    cocoapods-search      : 1.0.0
    cocoapods-stats       : 1.1.0
    cocoapods-trunk       : 1.5.0
    cocoapods-try         : 1.2.0
    ```
    ### Podfile
    ```ruby
    # Uncomment this line to define a global platform for your project
    platform :ios, '10.0'
    # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
    ENV['COCOAPODS_DISABLE_STATS'] = 'true'
    project 'Runner', {
      'Debug' => :debug,
      'Profile' => :release,
      'Release' => :release,
    }
    def flutter_root
      generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
      unless File.exist?(generated_xcode_build_settings_path)
        raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
      end
      File.foreach(generated_xcode_build_settings_path) do |line|
        matches = line.match(/FLUTTER_ROOT\=(.*)/)
        return matches[1].strip if matches
      end
      raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
    end
    require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
    flutter_ios_podfile_setup
    target 'Runner' do
      use_frameworks!
      use_modular_headers!
      flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
    end
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        flutter_additional_ios_build_settings(target)
      end
    end
    ```
    ### Error
    ```
    LoadError - dlsym(0x7fc2e3d12860, Init_ffi_c): symbol not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi.rb:6:in `rescue in <top (required)>'
    /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi.rb:3:in `<top (required)>'
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    /Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon.rb:2:in `<top (required)>'
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    /Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:440:in `download_typhoeus_impl_async'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:372:in `download_and_save_with_retries_async'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:365:in `download_file_async'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:338:in `download_file'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:284:in `ensure_versions_file_loaded'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:208:in `search'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/source/aggregate.rb:83:in `block in search'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/source/aggregate.rb:83:in `select'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/source/aggregate.rb:83:in `search'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:416:in `create_set_from_sources'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:385:in `find_cached_set'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:360:in `specifications_for_dependency'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:165:in `search_for'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:274:in `block in sort_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:267:in `each'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:267:in `sort_by'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:267:in `sort_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:53:in `block in sort_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:70:in `with_no_such_dependency_error_handling'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:52:in `sort_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:754:in `push_state_for_requirements'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:746:in `require_nested_dependencies_for'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:729:in `activate_new_spec'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:686:in `attempt_to_activate'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in `process_topmost_state'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:94:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:1074:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:414:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:160:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/command/install.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'
    ```
    ――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
    [!] Oh no, an error occurred.
    Search for existing GitHub issues similar to yours:
    https://github.com/CocoaPods/CocoaPods/search?q=dlsym%280x7fc2e3d12860%2C+Init_ffi_c%29%3A+symbol+not+found+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.13.1%2Flib%2Fffi_c.bundle&type=Issues
    If none exists, create a ticket, with the template displayed above, on:
    https://github.com/CocoaPods/CocoaPods/issues/new
    Be sure to first read the contributing guide for details on how to properly submit a ticket:
    https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
    Don't forget to anonymize any private data!
    Looking for related issues on cocoapods/cocoapods...
    Found no similar issues. To create a new issue, please visit:
    https://github.com/cocoapods/cocoapods/issues/new
Error running pod install
Error launching application on iPhone 12 Pro Max.
Exited (sigterm)

Incompatibility with firebase_messaging 6.0.9

I'm using firebase_messaging 6.0.9.

I've noticed notifications on Apple devices are spotty at best and wanted to try APNS.

When installing this plugin below is the trace:

 [app] flutter packages get
 Running "flutter pub get" in app...                          
 Because app depends on flutter_apns ^1.0.5 which depends on firebase_messaging ^5.1.8, firebase_messaging ^5.1.8 is required.
 So, because app depends on firebase_messaging ^6.0.9, version solving failed.
 
 pub get failed (1; So, because app depends on firebase_messaging ^6.0.9, version solving failed.)
 exit code 1

getting firebase_messaging token in addition to apns token

I would like to use the apns token to use my own server to send push notifications.
But in addition, i would like to send firebase push notification for other "marketing" push notification.
Do you think it would be possible to provide both tokens in case of iOS platform (apns + firebase) ?

Problem with firebase_messaging

I have this problem when add this with firebase_messaging.it throw the exception
Unhandled Exception: MissingPluginException(No implementation found for method getToken on channel plugins.flutter.io/firebase_messaging) #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:7) <asynchronous suspension> #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12) #2 FirebaseMessaging.getToken (package:firebase_messaging/firebase_messaging.dart:150:27) #3 _LoginFormState.validateToLogin (package:comanager/ui/login/login_form.dart:49:36) #4 _LoginFormState.build.<anonymous closure>.<anonymous closure> (package:comanager/ui/login/login_form.dart:269:32) #5 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:992:19) #6 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:1098:38) #7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:184:24) #8 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:524:11) #9 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:284:5) #10 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:256:7) #11 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:158:27) #12 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:224:20) #13 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:200:22) #14 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:158:7) #15 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:104:7) #16 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:88:7) #17 _rootRunUnary (dart:async/zone.dart:1206:13) #18 _CustomZone.runUnary (dart:async/zone.dart:1100:19) #19 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7) #20 _invoke1 (dart:ui/hooks.dart:267:10) #21 _dispatchPointerDataPacket (dart:ui/hooks.dart:176:5)

Flutter doctor

`[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/apple/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /Users/apple/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    ✗ Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0.1, Build version 12A7300
    • CocoaPods version 1.9.3

[✓] Android Studio
    • Android Studio at /Applications/Android Studio 4.1 Preview.app/Contents
    • Flutter plugin version 45.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
`

Update version of the firebase messaging dependency to 7.0.0

The firebase messaging plugin was updated in version 7.0.0 to use firebase_core features. It would be nice if the apns plugin would allow to use the updated version of firebase messaging. As there were no breaking changes, this shouldn't make any problems.

Currently a dependency resolution error is displayed when one tries to change the firebase messaging version to 7.0.0.

Getting Token

First of all, thank you very much for your service!

I'm trying to get the device token running through Xcode Iphone Simulator, but I'm not being able of getting the device token.

  • Is it possible get the token when running through the simulator?
    If so, should not print the token when:
    connector.token.addListener(() { print('Token ${connector.token.value}'); }); connector.requestNotificationPermissions();

Thanks!

The Apns Token get by listening the connector.token is it the same that FCM.getToken method return ?

Hi,

I just wanted to know if The Apns Token get by listening the connector.token is the same that Fcm.getToken method return ?
Because right know i'm using FCM, it works fine for Android but when it comes to IOS, i get messaging/registration-token-not-registered Error by FCM console when trying to send a notification.
So what i'm trying to do is to use directly the native ways of Apple to see if it can work.
Do i also have to change _firebaseMessaging.configure() with connector.configure() or i can keep my firebaseMessaging.configure even with IOS ?

[firebase_messaging] No messages in background. + [flutter_apns] No Token.

Hi, could anyone tell me please how to get firebase working on ios? I got firebase messaging etc. installed, but messages are only going through in simulators and if the app is in foreground. I tried getting it to work with flutter_apns but there I'm stuck at getting the token. But there it's only returning flutter: ValueNotifier<String># **some random value** (null). Does anyone know how to at least get the token and from then on, maybe get everything to work?
Thanks

App crashes on Start-up

When running my app on an iOS 14.4 emulator, the build succeeds but then connection to the device is immediately lost, and I get the following output in my Android Studio console:

Connected to _flutterView/0x7fba6a021e20.
[+3979 ms] Assertion failed: file flutter_apns/FlutterApnsPlugin.swift, line 100
[  +11 ms] Service protocol connection closed.
[        ] Lost connection to device.

I am using v 1.4.1 of the plugin

My flutter doctor output:


[✓] Flutter (Channel stable, 2.0.6, on macOS 11.2.1 20D74 darwin-x64, locale en-GB)
    • Flutter version 2.0.6 at /Users/nicholaslatham/flutter/flutter
    • Framework revision 1d9032c7e1 (3 weeks ago), 2021-04-29 17:37:58 -0700
    • Engine revision 05e680e202
    • Dart version 2.12.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/nicholaslatham/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 51.0.1
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (2 available)
    • iPhone 12 Pro Max (mobile) • DDBF54B9-78B5-44DC-A50E-1D1238A25B57 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 90.0.4430.212

• No issues found!


Is this maybe related to :

flutter/flutter#67624 (comment)

iOS still installing Firebase pods, expected?

I was not expecting flutter-apns to require Firebase pods on iOS, since it is only using it for Android.
Is this the expected behavior or might I be doing something wrong?
Would love not to include them.

image

token问题

ios存在获取不到token的情况,请问一下是什么原因

firebase background messages handling missing

Hi,

Thanks for your work!
I'd like to report that you're missing background message handling for firebase.
Can you please add it, or at least add support for only handling apns, letting users configure firebase directly through firebase-messaging?

Thanks again,
Regards

Compiler error: 'MessageHandler' is imported from both

Flutter 1.6.7 • channel dev • https://github.com/flutter/flutter.git
Framework • revision cba41ca2ec (6 weeks ago) • 2019-05-30 12:04:01 -0700
Engine • revision 58eff77ef2
Tools • Dart 2.3.2 (build 2.3.2-dev.0.0 fee615c5a5)

Compiler message:
file:///Users/elvin/.pub-cache/hosted/pub.flutter-io.cn/flutter_apns-1.0.0/lib/apns_connector.dart:5:1: Error: 'MessageHandler' is imported from both 'package:flutter_apns/connector.dart' and 'package:flutter/src/services/binary_messenger.dart'.
import 'package:flutter/services.dart';

flutter analyze fails on version 1.11.0

On the beta channel, the latest release (1.11.0) throws this error during flutter analyze:

Couldn't read file LocalFile:
'.../dev/lib/flutter/.pub-cache/git/flutter-apns-7f918932cf8bb9f283c19bab728ac557ff4a1141/android/src/main/kotlin/com/mwaysolutions/flutter/apns/FlutterApnsPlugin.kt' even though it exists. Please verify that this file has read permission and try again.

It is looking for a kotlin file, but there is no kotlin in the project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.