New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set id as a string #304
Comments
Not sure how you've bypassed the type checking on the Dart side but that's happening as only integer ids are supported. You'll need to implement your own logic to create the integer IDs |
I also get error when I run program on iOS *** First throw call stack: |
///// I get id In here as string
///////// In here when I .schedule I enter id |
Also in flutterLocalNotificationsPlugin.schedule I changed code to this:
|
As stated previously, the plugin only supports integer IDs. If you're making modifications to the plugin then that's up to you to maintain and fix |
I am developing a to-do list program. I want to set alarm id as the id of task from Firestore. Task id in Firestore is string with the mix of nums and letters. I tried to set id as a string but I got error in below:
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): Failed to handle method call
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): at com.dexterous.flutterlocalnotifications.models.NotificationDetails.from(NotificationDetails.java:152)
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.extractNotificationDetails(FlutterLocalNotificationsPlugin.java:727)
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.schedule(FlutterLocalNotificationsPlugin.java:680)
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.onMethodCall(FlutterLocalNotificationsPlugin.java:624)
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:643)
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): at android.os.MessageQueue.next(MessageQueue.java:325)
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): at android.os.Looper.loop(Looper.java:142)
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): at android.app.ActivityThread.main(ActivityThread.java:6944)
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
E/MethodChannel#dexterous.com/flutter/local_notifications(32579): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
E/flutter (32579): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, java.lang.String cannot be cast to java.lang.Integer, null)
E/flutter (32579): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter (32579): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316:33)
E/flutter (32579):
E/flutter (32579): #2 FlutterLocalNotificationsPlugin.schedule (package:flutter_local_notifications/src/flutter_local_notifications.dart:149:20)
E/flutter (32579):
E/flutter (32579): #3 _newTaskState._scheduleNotification (package:done/screens/newTask.dart:233:43)
E/flutter (32579):
E/flutter (32579): #4 _newTaskState.build.. (package:done/screens/newTask.dart:169:25)
E/flutter (32579): #5 _rootRun (dart:async/zone.dart:1120:38)
E/flutter (32579): #6 _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter (32579): #7 _FutureListener.handleWhenComplete (dart:async/future_impl.dart:150:18)
E/flutter (32579): #8 Future._propagateToListeners.handleWhenCompleteCallback (dart:async/future_impl.dart:609:39)
E/flutter (32579): #9 Future._propagateToListeners (dart:async/future_impl.dart:665:37)
E/flutter (32579): #10 Future._complete (dart:async/future_impl.dart:473:7)
E/flutter (32579): #11 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
E/flutter (32579): #12 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:28:18)
E/flutter (32579): #13 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:294:13)
E/flutter (32579): #14 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart)
E/flutter (32579):
E/flutter (32579): #15 DocumentReference.setData (package:cloud_firestore/src/document_reference.dart:51:30)
E/flutter (32579): #16 _newTaskState.build. (package:done/screens/newTask.dart:165:28)
E/flutter (32579): #17 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:635:14)
E/flutter (32579): #18 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:711:32)
E/flutter (32579): #19 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (32579): #20 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:365:11)
E/flutter (32579): #21 TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:312:7)
E/flutter (32579): #22 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter (32579): #23 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:222:20)
E/flutter (32579): #24 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter (32579): #25 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (32579): #26 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (32579): #27 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (32579): #28 _rootRunUnary (dart:async/zone.dart:1136:13)
E/flutter (32579): #29 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter (32579): #30 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
E/flutter (32579): #31 _invoke1 (dart:ui/hooks.dart:250:10)
E/flutter (32579): #32 _dispatchPointerDataPacket (dart:ui/hooks.dart:159:5)
E/flutter (32579):
V/InputMethodManager(32579): Starting input: tba=android.view.inputmethod.EditorInfo@d0a81cd nm : faridmirzayev.com.done ic=null
I/InputMethodManager(32579): startInputInner - mService.startInputOrWindowGainedFocus
D/SurfaceView(32579): BG show() Surface(name=Background for - SurfaceView - faridmirzayev.com.done/faridmirzayev.com.done.MainActivity@b8781f7@0) io.flutter.view.FlutterView{b8781f7 VFE...... .F....I. 0,0-1080,1920}
D/SurfaceView(32579): surfaceDestroyed 1 io.flutter.view.FlutterView{b8781f7 VFE...... .F....I. 0,0-1080,1920}
I/zygote64(32579): Do partial code cache collection, code=248KB, data=163KB
I/zygote64(32579): After code cache collection, code=248KB, data=163KB
I/zygote64(32579): Increasing code cache capacity to 1024KB
The text was updated successfully, but these errors were encountered: