-
Notifications
You must be signed in to change notification settings - Fork 55
Notification not rendering in app taskbar for background/terminated app #71
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
Comments
Would like to know what does this |
Update:- I am able to receive and handle the foreground message interaction after removing the Code // Initializing firebase background isolate
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
// If you're going to use other Firebase services in the background, such as Firestore,
// make sure you call `initializeApp` before using other Firebase services.
await Firebase.initializeApp();
CleverTapPlugin.createNotification(jsonEncode(message.data));
}
void main() async{
// register fcm background handler handles message on terminate state
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
} Logs
|
@snghnishant the |
No actually I only get this much log data even after the debug level is set to 3 |
I am adding some more info for your better understanding of the overall issues, maybe the issue could be with my SDK integration but that's what I can only do with limited documentation // MainActivity.kt
package `in`.stratzy
import io.flutter.embedding.android.FlutterFragmentActivity
class MainActivity: FlutterFragmentActivity() {
} Android Manifest <application
android:name="com.clevertap.android.sdk.Application"
android:label="Stratzy"
android:icon="@mipmap/ic_launcher">
<!-- Notification logo fix -->
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages. -->
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_stat_stratzy" />
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
notification message. See README(https://goo.gl/6BKBk7) for more. -->
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/colorGreen" />
<!-- [END fcm_default_icon] -->
<!-- [START fcm_default_channel] -->
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" />
<!-- [END fcm_default_channel] -->
<meta-data
android:name="CLEVERTAP_ACCOUNT_ID"
android:value="xxxxx-xxxxx-WK6Z"/>
<meta-data
android:name="CLEVERTAP_TOKEN"
android:value="xxxxxxxx"/>
<!-- IMPORTANT: To force use Google AD ID to uniquely identify users, use the following meta tag. GDPR mandates that if you are using this tag, there is prominent disclousure to your end customer in their application. Read more about GDPR here - https://clevertap.com/blog/in-preparation-of-gdpr-compliance/ -->
<meta-data
android:name="CLEVERTAP_USE_GOOGLE_AD_ID"
android:value="1"/>
<!--Facebook analytics-->
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- Deep linking -->
<!-- <meta-data android:name="flutter_deeplinking_enabled" android:value="true" />-->
<!-- <intent-filter android:autoVerify="true">-->
<!-- <action android:name="android.intent.action.VIEW" />-->
<!-- <category android:name="android.intent.category.DEFAULT" />-->
<!-- <category android:name="android.intent.category.BROWSABLE" />-->
<!-- <data android:scheme="http" android:host="stratzy.in" />-->
<!-- <data android:scheme="https" />-->
<!-- </intent-filter>-->
<!-- Deep Links -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with YOUR_SCHEME://YOUR_HOST -->
<data
android:scheme="https"
android:host="stratzy.page.link" />
</intent-filter>
</activity>
<!-- Clevertap, read -https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTV4CHANGES.md -->
<!-- to use Firebase messaging-->
<service android:name="com.clevertap.android.sdk.pushnotification.fcm.FcmMessageListenerService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- to enable push notification-->
<service
android:name="com.clevertap.android.sdk.pushnotification.CTNotificationIntentService"
android:exported="false">
<intent-filter>
<action android:name="com.clevertap.PUSH_EVENT" />
</intent-filter>
</service>
<!--To enable Push Amplification-->
<meta-data
android:name="CLEVERTAP_BACKGROUND_SYNC"
android:value="1"/>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application> |
@darshanclevertap quick update: now we are able to see the notification getting rendered in the system UI tray, you can close this issue. Thanks! |
@snghnishant Before I close the issue, can you share what you have done so that it can help our other users as well? |
@darshanclevertap Eventually It started working today when I tried pushing the notification from the CleverTap dashboard on my FCM token. No changes were made for this. I'll have my custom docs for CleverTap integration linked here with code later for handling the redirects in all three app state(Background, Terminated, Foreground) after testing it on iOS too. |
@snghnishant Did you have custom docs for CleverTap integration linked here with code later for handling the redirects in all three app state(Background, Terminated, Foreground) yet |
Uh oh!
There was an error while loading. Please reload this page.
Flutter 2.2.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 02c026b03c (4 months ago) • 2021-05-27 12:24:44 -0700
Engine • revision 0fdb562ac8
Tools • Dart 2.13.1
firebase_messaging: ^10.0.0
clevertap_plugin: 1.3.0
The text was updated successfully, but these errors were encountered: