mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
@@ -2,14 +2,9 @@ import 'package:fl_lib/fl_lib.dart';
|
|||||||
import 'package:plain_notification_token/plain_notification_token.dart';
|
import 'package:plain_notification_token/plain_notification_token.dart';
|
||||||
|
|
||||||
Future<String?> getToken() async {
|
Future<String?> getToken() async {
|
||||||
if (isIOS) {
|
if (!isIOS) return null;
|
||||||
final plainNotificationToken = PlainNotificationToken();
|
final instance = ApnsToken()..requestPermission();
|
||||||
plainNotificationToken.requestPermission();
|
// Wait until Permission dialog closed
|
||||||
|
await instance.onIosSettingsRegistered.first;
|
||||||
// If you want to wait until Permission dialog close,
|
return await instance.getToken();
|
||||||
// you need wait changing setting registered.
|
|
||||||
await plainNotificationToken.onIosSettingsRegistered.first;
|
|
||||||
return await plainNotificationToken.getToken();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -989,10 +989,11 @@ packages:
|
|||||||
plain_notification_token:
|
plain_notification_token:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: plain_notification_token
|
path: "."
|
||||||
sha256: "32481c1c6ad76613ed38822ffe819ea5d5534f9e07e8ff1d44aafe069f45ea24"
|
ref: master
|
||||||
url: "https://pub.dev"
|
resolved-ref: "5f56dc56a6670e2533b0caa7d09d31d16e6c7663"
|
||||||
source: hosted
|
url: "https://github.com/lollipopkit/plain_notification_token"
|
||||||
|
source: git
|
||||||
version: "0.0.4"
|
version: "0.0.4"
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ dependencies:
|
|||||||
after_layout: ^1.1.0
|
after_layout: ^1.1.0
|
||||||
easy_isolate: ^1.3.0
|
easy_isolate: ^1.3.0
|
||||||
intl: ^0.19.0
|
intl: ^0.19.0
|
||||||
plain_notification_token: ^0.0.4
|
|
||||||
highlight: ^0.7.0
|
highlight: ^0.7.0
|
||||||
flutter_highlight: ^0.7.0
|
flutter_highlight: ^0.7.0
|
||||||
code_text_field: ^1.1.0
|
code_text_field: ^1.1.0
|
||||||
@@ -50,6 +49,10 @@ dependencies:
|
|||||||
git:
|
git:
|
||||||
url: https://github.com/lollipopkit/dart_computer
|
url: https://github.com/lollipopkit/dart_computer
|
||||||
ref: master
|
ref: master
|
||||||
|
plain_notification_token:
|
||||||
|
git:
|
||||||
|
url: https://github.com/lollipopkit/plain_notification_token
|
||||||
|
ref: master
|
||||||
fl_lib:
|
fl_lib:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/lppcg/fl_lib
|
url: https://github.com/lppcg/fl_lib
|
||||||
|
|||||||
Reference in New Issue
Block a user