Repository navigation
Releases
Releases · cometchat/push-notifications-sdk-flutter
v2.0.0
cometchat_push_notifications 2.0.0
New
- Android notifications are now built by this package: one per conversation, expanding into its recent messages, with the sender's avatar and a summary across conversations.
- A Notification Service Extension base class for iOS,
CometChatNotificationServiceExtension, shipped as theCometChatPushNotificationsNSEpod. It sends delivery receipts while the app is backgrounded or killed, attaches the sender's avatar, groups notifications by conversation and strips markdown a notification cannot render. onNotificationTapreports taps, holding a cold-start tap until a listener attaches so it is not lost to app startup.setActiveConversationtakes a receiver type alongside the id, as aCometChatPushReceiverType. It is named apart from the Chat SDK'sCometChatReceiverTypeon purpose: both are in scope in any UI Kit app, and matching names there are anambiguous_importerror at the point of use.PushPlatformcoversFCM_FLUTTER_IOSandFCM_WEB. 1.x had neither, so an iOS app usingfirebase_messaging— the usual Flutter setup — had no correct value to register its FCM token under.- Web has a real implementation. It reaches as far as Dart does — token registration and the rest of the API — and no-ops the display methods, since a web push is delivered to a service worker.
initused to throw there. - A privacy manifest for iOS.
Enhancements
notification_voip_pluginis no longer a dependency.cometchat_sdkmoves to5.0.9.- The push token now carries
ringingFlowVersion: "v2"and always atimezone, as the native Android and iOS SDKs send them. The Chat SDK'sCometChatNotifications.registerPushTokencannot carry the field, so the token is now registered with CometChat directly, under the Chat SDK's auth token, overdart:io(Android, iOS) orfetch(web). No new dependency. registerPushTokenandunregisterPushTokenthrowCometChatNotificationExceptionon failure, carrying the SDK's error code and message alongside the platform and provider id they used.- The package no longer claims Android's
FirebaseMessagingService. Your app keeps its messaging library and forwards payloads tohandlePushNotification, which now reports whether it took the payload.
Fixes
- Clearing notifications no longer cancels notifications this package did not post.
clearAll()calledcancelAll(), taking down the host app's own. - Cancelling one conversation's notification now works. It targeted a
(tag, id: 0)pair that never matched what was posted. showInAppNotificationsnow has an effect on Android, where it was sent to a native setter that did not exist.- A tap on a notification that launched a killed app now opens the conversation rather than the conversation list: the tap is held until a listener attaches instead of being lost to app startup.
- Notification suppression no longer applies to the wrong conversation when a user and a group share an id.
setActiveConversationtakes the receiver type with the id, so the two can no longer collide.
Removed
- Calling, in full: the call screen, call handlers,
CometChatCallDetails, the incoming-call activity, and every call member on the facade. It moves to its own package,cometchat_voip. PushPlatform.APNS_FLUTTER_VOIP. Chat delivery runs over the APNs device token, so a chat integrator has no VoIP provider to register against.NvpConfigand every othernotification_voip_plugintype.onPushReceived, which reported what your messaging library already gives you, along withparsePayload,showNotificationandshowInAppNotification:handlePushNotificationparses and posts.openAutoStartSettings,openOverlaySettingsandopenBatteryOptimizationSettings, which belonged to ringing.openFullScreenIntentSettingsmoves toCometChatVoip.openSettings(CometChatRingReadiness.fullScreenIntentDenied).- Inline reply. A notification carried a reply field, and the reply was sent through
cometchat_sdk— from a background isolate when the app was dead. Sending a message is the app's job, not a notification package's, and the machinery it needed (a broadcast receiver, an on-disk queue, a headless Flutter engine, a second entry point the tree shaker could drop) cost more than the feature returned.CometChatNotificationAction,replyText,enableInlineReply,onBackgroundSetupandonNotificationResponsego with it; useonNotificationTap.
Breaking changes
- The push transport is now yours. Add a messaging library such as
firebase_messagingand forward every payload tohandlePushNotification, which reports whether it took the payload — call and other non-chat payloads come backfalsefor you to route onward (tocometchat_voip, for a call). - Renamed:
registerTokentoregisterPushToken(now aFuturethat throws on failure),getPushTokentogetApnsToken(iOS only),cancelNotification(tag)toclearNotifications(conversationId:),clearAll()toclearNotifications(), andsetCurrentOpenChatId(id)tosetActiveConversation(id:, receiverType:), which now requires the receiver type. CometChatReceiverTypeis nowCometChatPushReceiverType, to resolve anambiguous_importagainst the Chat SDK's type of the same name in UI Kit apps.nvpConfigonCometChatNotificationConfiggives way to native fields such asandroidChannelIdandandroidSmallIcon.- iOS needs a Notification Service Extension for delivery receipts and sender avatars while the app is backgrounded or killed. Add one that subclasses
CometChatNotificationServiceExtension.
cometchat_voip 2.0.0
New
- Three ways to take an incoming call, as
CometChatCallMode: auto(the default): the package rings — the notification, the ringtone, the expiry, the keep-alive, and Answer and Decline from the lock screen.autoCustomScreen: everythingautodoes, except that the ring's full-screen alert and its tap open the app, which draws its own ring screen fromCometChatVoip.onRingScreenRequested. Held until the screen subscribes, so a cold-start ring is not missed. Android only; iOS rings in CallKit, as it must.manual: the package parses, gates and forwards, and the app rings.CometChatVoip.ringSurfacesoffers each step ofautoon its own (Android).- iOS: the package owns the PushKit registry and the
CXProvider, and reports every VoIP push to CallKit before acknowledging it. Presentation is set withCometChatCallKitOptions. - Android: a CallStyle notification with Answer and Decline, full screen over the lock screen, held by a
phoneCallforeground service until the answered call joins. A decline tapped after the app was killed is sent from a headless isolate. - The call connects while it rings, so answering only adds media.
- Call waiting. A second call rings over the live one and says that answering ends it ("End & accept"); declining it sends
busy. A third call, or one that arrives while this device's own outgoing call is still ringing, is refused asbusyand shown as a missed call (Android). - Ring gates, as on the native SDKs: a call this user placed, a one-to-one call addressed to someone else, a duplicate and a call already over never ring. A call that arrives past its ring window is dropped (
dropExpiredCalls).RingGateandTerminalLedgerare exported. - Durable declines: WorkManager on Android, a background task with replay on iOS. A one-to-one ring that times out sends
unanswered; a group call declined or timed out ends locally and carries on for the other members. - A caller is told how its call ended: a decline, busy or cancel reaches the caller's
IncomingCallListenerthrough the Calls SDK. - Missed calls: a notification on Android (
showMissedCallNotification), Recents on iOS. - iOS: calls this device places are on CallKit too, from the moment they are placed — a Recents entry whether or not anyone answers, a hang-up from the lock screen while the callee still rings (
onOutgoingCallEnded), and survival of a cellular call.reportOutgoingCallnames the callee and the call type; a session the Calls SDK owns that CallKit has not heard of is reported by the package itself and renamed when a participant connects. onCallRinging,onCallAnsweredandonCallEnded, holding the answer that launched the app until something listens. Every ringing call also reaches the Calls SDK'sIncomingCallListener.answer,accept,decline,dismissRingingandgetActiveCall.permissionsToAnswerandrequestCallPermissionscover the microphone, and the camera for video;answerasks by itself whenrequestCallPermissionsis on.reportOutgoingCall,reportCallConnected,reportCallEnded,reportMutedandreportVideoPausedkeep CallKit in step with the call. They are optional: the package follows the Calls SDK's session and media events itself.- Push tokens register on every Calls SDK login, with no Chat SDK:
registerPushToken,setPushToken,handleTokenRefresh,handleRegistrationFailure,unregisterPushToken, andgetVoipTokenon iOS. Each registration carriesringingFlowVersion: "v2"and atimezone, as the native SDKs send them; a device that cannot name its zone sends a fixed-offset zone from its UTC offset (orUTC) rather than nothing. acceptOnAnswermarks an answered callongoing, which a caller on the Chat SDK's calling waits for.- Setup checks:
verifyPushSetup,checkRingReadiness,openSettings,requestNotificationPermission,lastWakeTiming, andgetDiagnostics— a redacted snapshot for a bug report. CometChatVoipConfig.fromCallAppSettingsbuilds the config from the Calls SDK settings the app already has. Also configurable:defaultRingTimeout,timezone,clientHost,extensionGroupIDandcallKitAudio.CometChatVoipCallcarriessource,extrasandinitials.- `CometChatVo...
v1.0.1
New
- None
Enhancements
- Updated the required
cometchat_sdkdependency to version5.0.6. - Added
homepageandrepositorylinks to the package metadata, making the source repository and website discoverable from the pub.dev listing.
Fixes
- None