Skip to content

Commit 437be58

Browse files
committed
feat: delete unused file and regenerate pigeon code
1 parent 2b77467 commit 437be58

File tree

10 files changed

+55
-127
lines changed

10 files changed

+55
-127
lines changed

android/src/main/kotlin/uk/orth/push/serialization/PushApi.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,14 @@ interface PushHostApi {
316316
* will get an error: `Requested entity was not found.`
317317
*/
318318
fun deleteToken(callback: (Result<Unit>) -> Unit)
319+
/**
320+
* iOS only
321+
* Registration is done automatically when the application starts.
322+
* This is only useful if you previously called [PushHostApi.unregisterForRemoteNotifications].
323+
* You'll get the next token from [PushFlutterApi.onNewToken]. Unfortunately, this would most likely be
324+
* the same token as before you called [PushHostApi.unregisterForRemoteNotifications].
325+
*/
326+
fun registerForRemoteNotifications()
319327
/**
320328
* iOS only
321329
* Temporary disable receiving push notifications until next app restart. You can re-enable immediately with [PushHostApi.registerForRemoteNotifications].
@@ -325,14 +333,6 @@ interface PushHostApi {
325333
* Warning: on IOS simulators, no notifications will be delivered when calling unregisterForRemoteNotifications and then `registerForRemoteNotifications`
326334
*/
327335
fun unregisterForRemoteNotifications()
328-
/**
329-
* iOS only
330-
* Registration is done automatically when the application starts.
331-
* This is only useful if you previously called [PushHostApi.unregisterForRemoteNotifications].
332-
* You'll get the next token from [PushFlutterApi.onNewToken]. Unfortunately, this would most likely be
333-
* the same token as before you called [PushHostApi.unregisterForRemoteNotifications].
334-
*/
335-
fun registerForRemoteNotifications()
336336
fun backgroundFlutterApplicationReady()
337337
/**
338338
* Pass true for the option you want permission to use
@@ -402,11 +402,11 @@ interface PushHostApi {
402402
}
403403
}
404404
run {
405-
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.push.PushHostApi.unregisterForRemoteNotifications$separatedMessageChannelSuffix", codec)
405+
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.push.PushHostApi.registerForRemoteNotifications$separatedMessageChannelSuffix", codec)
406406
if (api != null) {
407407
channel.setMessageHandler { _, reply ->
408408
val wrapped: List<Any?> = try {
409-
api.unregisterForRemoteNotifications()
409+
api.registerForRemoteNotifications()
410410
listOf(null)
411411
} catch (exception: Throwable) {
412412
wrapError(exception)
@@ -418,11 +418,11 @@ interface PushHostApi {
418418
}
419419
}
420420
run {
421-
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.push.PushHostApi.registerForRemoteNotifications$separatedMessageChannelSuffix", codec)
421+
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.push.PushHostApi.unregisterForRemoteNotifications$separatedMessageChannelSuffix", codec)
422422
if (api != null) {
423423
channel.setMessageHandler { _, reply ->
424424
val wrapped: List<Any?> = try {
425-
api.registerForRemoteNotifications()
425+
api.unregisterForRemoteNotifications()
426426
listOf(null)
427427
} catch (exception: Throwable) {
428428
wrapError(exception)

darwin/Classes/serialization/PushApi.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,18 @@ NSObject<FlutterMessageCodec> *PUGetPushApiCodec(void);
141141
/// will get an error: `Requested entity was not found.`
142142
- (void)deleteTokenWithCompletion:(void (^)(FlutterError *_Nullable))completion;
143143
/// iOS only
144+
/// Registration is done automatically when the application starts.
145+
/// This is only useful if you previously called [PushHostApi.unregisterForRemoteNotifications].
146+
/// You'll get the next token from [PushFlutterApi.onNewToken]. Unfortunately, this would most likely be
147+
/// the same token as before you called [PushHostApi.unregisterForRemoteNotifications].
148+
- (void)registerForRemoteNotificationsWithError:(FlutterError *_Nullable *_Nonnull)error;
149+
/// iOS only
144150
/// Temporary disable receiving push notifications until next app restart. You can re-enable immediately with [PushHostApi.registerForRemoteNotifications].
145151
/// This might be useful if you're logging someone out or you want to completely disable all notifications.
146152
/// Trying to send an APNs message to the token will fail, until `registerForRemoteNotifications` is called.
147153
/// For iOS details, see https://developer.apple.com/documentation/uikit/uiapplication/1623093-unregisterforremotenotifications
148154
/// Warning: on IOS simulators, no notifications will be delivered when calling unregisterForRemoteNotifications and then `registerForRemoteNotifications`
149155
- (void)unregisterForRemoteNotificationsWithError:(FlutterError *_Nullable *_Nonnull)error;
150-
/// iOS only
151-
/// Registration is done automatically when the application starts.
152-
/// This is only useful if you previously called [PushHostApi.unregisterForRemoteNotifications].
153-
/// You'll get the next token from [PushFlutterApi.onNewToken]. Unfortunately, this would most likely be
154-
/// the same token as before you called [PushHostApi.unregisterForRemoteNotifications].
155-
- (void)registerForRemoteNotificationsWithError:(FlutterError *_Nullable *_Nonnull)error;
156156
- (void)backgroundFlutterApplicationReadyWithError:(FlutterError *_Nullable *_Nonnull)error;
157157
/// Pass true for the option you want permission to use
158158
/// Returns true if permission was granted.

darwin/Classes/serialization/PushApi.m

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -375,44 +375,44 @@ void SetUpPUPushHostApiWithSuffix(id<FlutterBinaryMessenger> binaryMessenger, NS
375375
}
376376
}
377377
/// iOS only
378-
/// Temporary disable receiving push notifications until next app restart. You can re-enable immediately with [PushHostApi.registerForRemoteNotifications].
379-
/// This might be useful if you're logging someone out or you want to completely disable all notifications.
380-
/// Trying to send an APNs message to the token will fail, until `registerForRemoteNotifications` is called.
381-
/// For iOS details, see https://developer.apple.com/documentation/uikit/uiapplication/1623093-unregisterforremotenotifications
382-
/// Warning: on IOS simulators, no notifications will be delivered when calling unregisterForRemoteNotifications and then `registerForRemoteNotifications`
378+
/// Registration is done automatically when the application starts.
379+
/// This is only useful if you previously called [PushHostApi.unregisterForRemoteNotifications].
380+
/// You'll get the next token from [PushFlutterApi.onNewToken]. Unfortunately, this would most likely be
381+
/// the same token as before you called [PushHostApi.unregisterForRemoteNotifications].
383382
{
384383
FlutterBasicMessageChannel *channel =
385384
[[FlutterBasicMessageChannel alloc]
386-
initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.push.PushHostApi.unregisterForRemoteNotifications", messageChannelSuffix]
385+
initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.push.PushHostApi.registerForRemoteNotifications", messageChannelSuffix]
387386
binaryMessenger:binaryMessenger
388387
codec:PUGetPushApiCodec()];
389388
if (api) {
390-
NSCAssert([api respondsToSelector:@selector(unregisterForRemoteNotificationsWithError:)], @"PUPushHostApi api (%@) doesn't respond to @selector(unregisterForRemoteNotificationsWithError:)", api);
389+
NSCAssert([api respondsToSelector:@selector(registerForRemoteNotificationsWithError:)], @"PUPushHostApi api (%@) doesn't respond to @selector(registerForRemoteNotificationsWithError:)", api);
391390
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
392391
FlutterError *error;
393-
[api unregisterForRemoteNotificationsWithError:&error];
392+
[api registerForRemoteNotificationsWithError:&error];
394393
callback(wrapResult(nil, error));
395394
}];
396395
} else {
397396
[channel setMessageHandler:nil];
398397
}
399398
}
400399
/// iOS only
401-
/// Registration is done automatically when the application starts.
402-
/// This is only useful if you previously called [PushHostApi.unregisterForRemoteNotifications].
403-
/// You'll get the next token from [PushFlutterApi.onNewToken]. Unfortunately, this would most likely be
404-
/// the same token as before you called [PushHostApi.unregisterForRemoteNotifications].
400+
/// Temporary disable receiving push notifications until next app restart. You can re-enable immediately with [PushHostApi.registerForRemoteNotifications].
401+
/// This might be useful if you're logging someone out or you want to completely disable all notifications.
402+
/// Trying to send an APNs message to the token will fail, until `registerForRemoteNotifications` is called.
403+
/// For iOS details, see https://developer.apple.com/documentation/uikit/uiapplication/1623093-unregisterforremotenotifications
404+
/// Warning: on IOS simulators, no notifications will be delivered when calling unregisterForRemoteNotifications and then `registerForRemoteNotifications`
405405
{
406406
FlutterBasicMessageChannel *channel =
407407
[[FlutterBasicMessageChannel alloc]
408-
initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.push.PushHostApi.registerForRemoteNotifications", messageChannelSuffix]
408+
initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.push.PushHostApi.unregisterForRemoteNotifications", messageChannelSuffix]
409409
binaryMessenger:binaryMessenger
410410
codec:PUGetPushApiCodec()];
411411
if (api) {
412-
NSCAssert([api respondsToSelector:@selector(registerForRemoteNotificationsWithError:)], @"PUPushHostApi api (%@) doesn't respond to @selector(registerForRemoteNotificationsWithError:)", api);
412+
NSCAssert([api respondsToSelector:@selector(unregisterForRemoteNotificationsWithError:)], @"PUPushHostApi api (%@) doesn't respond to @selector(unregisterForRemoteNotificationsWithError:)", api);
413413
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
414414
FlutterError *error;
415-
[api registerForRemoteNotificationsWithError:&error];
415+
[api unregisterForRemoteNotificationsWithError:&error];
416416
callback(wrapResult(nil, error));
417417
}];
418418
} else {

example/lib/main.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ Future<FlutterLocalNotificationsPlugin>
3838
}
3939

4040
class MyApp extends HookWidget {
41-
const MyApp(this.flutterLocalNotificationsPlugin, {Key? key})
42-
: super(key: key);
41+
const MyApp(this.flutterLocalNotificationsPlugin, {super.key});
4342
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
4443

4544
@override
@@ -251,7 +250,6 @@ class MyApp extends HookWidget {
251250
children: [
252251
...tappedNotificationPayloads
253252
.map((data) => TextRow("Data", data.toString()))
254-
.toList()
255253
],
256254
),
257255
],

example/lib/metadata_sliver.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'package:push_example/use_push_token.dart';
66
import 'package:share_plus/share_plus.dart';
77

88
class MetadataSliver extends HookWidget {
9-
const MetadataSliver({Key? key}) : super(key: key);
9+
const MetadataSliver({super.key});
1010

1111
@override
1212
Widget build(BuildContext context) {

lib/src/serialization/push_api.dart

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -363,14 +363,13 @@ class PushHostApi {
363363
}
364364

365365
/// iOS only
366-
/// Temporary disable receiving push notifications until next app restart. You can re-enable immediately with [PushHostApi.registerForRemoteNotifications].
367-
/// This might be useful if you're logging someone out or you want to completely disable all notifications.
368-
/// Trying to send an APNs message to the token will fail, until `registerForRemoteNotifications` is called.
369-
/// For iOS details, see https://developer.apple.com/documentation/uikit/uiapplication/1623093-unregisterforremotenotifications
370-
/// Warning: on IOS simulators, no notifications will be delivered when calling unregisterForRemoteNotifications and then `registerForRemoteNotifications`
371-
Future<void> unregisterForRemoteNotifications() async {
366+
/// Registration is done automatically when the application starts.
367+
/// This is only useful if you previously called [PushHostApi.unregisterForRemoteNotifications].
368+
/// You'll get the next token from [PushFlutterApi.onNewToken]. Unfortunately, this would most likely be
369+
/// the same token as before you called [PushHostApi.unregisterForRemoteNotifications].
370+
Future<void> registerForRemoteNotifications() async {
372371
final String pigeonVar_channelName =
373-
'dev.flutter.pigeon.push.PushHostApi.unregisterForRemoteNotifications$pigeonVar_messageChannelSuffix';
372+
'dev.flutter.pigeon.push.PushHostApi.registerForRemoteNotifications$pigeonVar_messageChannelSuffix';
374373
final BasicMessageChannel<Object?> pigeonVar_channel =
375374
BasicMessageChannel<Object?>(
376375
pigeonVar_channelName,
@@ -393,13 +392,14 @@ class PushHostApi {
393392
}
394393

395394
/// iOS only
396-
/// Registration is done automatically when the application starts.
397-
/// This is only useful if you previously called [PushHostApi.unregisterForRemoteNotifications].
398-
/// You'll get the next token from [PushFlutterApi.onNewToken]. Unfortunately, this would most likely be
399-
/// the same token as before you called [PushHostApi.unregisterForRemoteNotifications].
400-
Future<void> registerForRemoteNotifications() async {
395+
/// Temporary disable receiving push notifications until next app restart. You can re-enable immediately with [PushHostApi.registerForRemoteNotifications].
396+
/// This might be useful if you're logging someone out or you want to completely disable all notifications.
397+
/// Trying to send an APNs message to the token will fail, until `registerForRemoteNotifications` is called.
398+
/// For iOS details, see https://developer.apple.com/documentation/uikit/uiapplication/1623093-unregisterforremotenotifications
399+
/// Warning: on IOS simulators, no notifications will be delivered when calling unregisterForRemoteNotifications and then `registerForRemoteNotifications`
400+
Future<void> unregisterForRemoteNotifications() async {
401401
final String pigeonVar_channelName =
402-
'dev.flutter.pigeon.push.PushHostApi.registerForRemoteNotifications$pigeonVar_messageChannelSuffix';
402+
'dev.flutter.pigeon.push.PushHostApi.unregisterForRemoteNotifications$pigeonVar_messageChannelSuffix';
403403
final BasicMessageChannel<Object?> pigeonVar_channel =
404404
BasicMessageChannel<Object?>(
405405
pigeonVar_channelName,

mise.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ description = "Lint"
33
run = [
44
'dart format --set-exit-if-changed .',
55
'swiftformat --lint --exclude example/macos/Flutter/GeneratedPluginRegistrant.swift .',
6+
'flutter analyze',
67
]
78

89
[tasks.format]

pubspec.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ packages:
151151
dependency: "direct dev"
152152
description:
153153
name: flutter_lints
154-
sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
154+
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
155155
url: "https://pub.dev"
156156
source: hosted
157-
version: "3.0.2"
157+
version: "5.0.0"
158158
flutter_test:
159159
dependency: "direct dev"
160160
description: flutter
@@ -204,10 +204,10 @@ packages:
204204
dependency: transitive
205205
description:
206206
name: lints
207-
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
207+
sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7
208208
url: "https://pub.dev"
209209
source: hosted
210-
version: "3.0.0"
210+
version: "5.1.1"
211211
macros:
212212
dependency: transitive
213213
description:
@@ -374,5 +374,5 @@ packages:
374374
source: hosted
375375
version: "3.1.3"
376376
sdks:
377-
dart: ">=3.5.0 <4.0.0"
377+
dart: ">=3.6.0 <4.0.0"
378378
flutter: ">=3.18.0-18.0.pre.54"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ flutter:
3737
dev_dependencies:
3838
flutter_test:
3939
sdk: flutter
40-
flutter_lints: ^3.0.2
40+
flutter_lints: ^5.0.0
4141
pigeon: ^22.7.2
4242

4343
# For information on the generic Dart part of this file, see the

test/codegen/push_api_test.dart

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)