Closed simonarcher closed 1 year ago
I have a similar setup and encountered the same issue
Sorry you're experiencing issues with images not showing up in a rich push notification. Let's see how we can help.
that in that step it mentions to include import CioTracking to the file, so I did that to my Swift step and the error disappeared. Is this a mistake in the documentation, or did I possibly make a mistake somewhere earlier where importing CioTracking would not be necessary?
Yes, you need to add import CioTracking
to the top of the NotificationService
file. Our docs team is fixing the docs right now to add in that missing import statement. Thanks for bringing this to your attention and sorry for making that mistake.
As far as debugging why this is happening to you, I have a couple tips.
But before you do that, see my tip below about SDK logs. That might be easier then getting breakpoints working.
config.logLevel = .info
enabled. To help us diagnose better what behavior your app is experiencing, could you modify that from .info
to .debug
and then follow our instructions on how to view SDK debug logs and send them to us. Get SDK logs showing up in Console, send yourself a push notification with an image in it, save those SDK logs, and share them with us (you can also view them to see if you catch anything 😄). Push issues such as this one are difficult to diagnose as there are so many pieces involved in the process. SDK logs are the best tool to view the behavior of the push notifications and how the SDK is behaving.
Thanks @levibostian for the detailed explanation. When using Rich Push Notifications, we still need to include the regular push notification implementation, right? In addition, can a Rich Push Notification be sent via the Push UI Builder or it has to be a custom payload? I'm asking because there's an option to include an image in the builder so want to be sure
When using Rich Push Notifications, we still need to include the regular push notification implementation, right?
Yes. Rich push requires having regular push setup. We are actively improving our docs to combine these 2 sections to make this more clear that both are required.
In addition, can a Rich Push Notification be sent via the Push UI Builder or it has to be a custom payload? I'm asking because there's an option to include an image in the builder so want to be sure
We recommend using the push UI builder 😄. It's awesome! Custom payloads UI can be used, but we hope that you don't need to use it. If there is ever a use case where you believe you need to use it, we would appreciate you reach out to us at product [at] customer.io
and explain the use case. So we can improve the push UI builder!
@levibostian thanks for the detailed reply!
So I followed your suggestions,
As far as debugging why this is happening to you, I have a couple tips.
Xcode breakpoints inside of your Notification Service will not trigger by default. It's a tricky iOS behavior. I have some documentation to share (skip the section talking about JSON payloads if you're using our Rich Push composer in Customer.io) to help guide you on how to make breakpoints trigger inside of the Notification Service.
I tried to attach to the process as guided in the link, but when I attempt to I get this error
Trying to find the logs that it speaks of in the consoles app, but cant find them or see them..
I then worked on doing the debugging logs step as you also suggested, but when I send a push notification I dont see anything really that provides any clues. When I launch the app, these are the only CIO
logs I see, and nothing more when I start sending push or rich push notifications
2023-02-01 16:31:45.337750+0100 [CIO] (siteid:xxx) ℹ️ Customer.io SDK 2.0.4 initialized and ready to use for site id: xxxxx
2023-02-01 16:31:45.338349+0100 [CIO] (siteid: xxx) deleting expired tasks from the queue
2023-02-01 16:31:45.341700+0100 [CIO] (siteid: xxx) deleting tasks older then 2023-01-29T16:31:45+0100,
2023-02-01 16:31:45.342753+0100 [CIO] (siteid: xxx) deleting 0 tasks.
2023-02-01 16:31:45.377912+0100 [CIO] (siteid: xxx) ℹ️ registering device token cBobZpEwHEDhsnpj8Rt5nv:APA91bHpIGXVwQ3FJsHBXCHYD9q8gYhOoexxxxxxx
2023-02-01 16:31:45.377924+0100 [CIO] (siteid:b5ac9) storing device token to device storage cBobZpEwHEDhsnpj8Rt5nv:APA91bHpIGXVwQ3FJsHBXCHYD9q8gYhOoexxxxxx
2023-02-01 16:31:45.379528+0100 [CIO] (siteid:b5ac9) ℹ️ no profile identified, so not registering device token to a profile
so now im at a dead end again 😅
Any idea what I could do next to help get to the bottom of this further? thanks!
@levibostian hey Levi! do you have any idea how I could possibly move forward with this?
Bummer to hear that debugger didn't work for you to hit breakpoints in Xcode. My guess is that's a React Native behavior? I am unsure though as I only do native iOS development. Either way, if you are able to see SDK logs in the Console
app, that should work just as well as Xcode breakpoints so let's continue down that path.
A summary of the problem to this point: Expected: See a push notification on the device with an image inside of a push notification. Actual: See a push on the device, but on image shown in it.
What could be causing this problem:
Let's start by trying to confirm the NSE is executing.
Here is how I would confirm that:
NotificationService
class, make sure logs are setup to generate: class NotificationService: UNNotificationServiceExtension {
...
CustomerIO.initialize(siteId: SettingsConfiguration.customerIoSiteID, apiKey: SettingsConfiguration.customerIoAPIKey, region: .EU) { config in
config.logLevel = .info <--- how to enable logs in the NSE code
}
...
}
Looking at the code you sent me for the NotificationService
class you created, you have enabled logs already with the .info
log level. That will work good enough for now. If you want more logs to further help you debug, change .info
to .debug
.
Console
as before and send yourself a push notification with an image attached. You should see logs from the Customer.io SDK show up from your host app and from your NSE. In the console logs, you should see the Process column show 2 different values: 1 value is for SDK logs generated from your iOS app and 1 value is SDK logs generated from the NSE code.
If you see SDK logs generated from 2 separate Processes in Console, then that means the NSE code in your app is being executed! That's good because that means the Customer.io SDK is processing the push. If you only see SDK logs from 1 Process, the NSE code is not being executed. To fix that, I recommend going through our iOS SDK docs as it might contain more steps then our React Native docs do for setting up a NSE? Share feedback with me (as you have done already, thank you!) if you find docs missing for setting up NSE.
Try this out and see what it gives you for logs. Share those logs with me here or win@customer.io
and we can see how to help you move forward.
Closing due to inactivity. Feel free to re-open.
SDK version:
pod 'CustomerIO/MessagingPushFCM', '~> 2.0.4'
"customerio-reactnative": "^2.0.0"
"react-native": "0.71.1"
Are logs available?
Describe the issue
Im trying to add Rich Push Notification support by following the documentation found here. While the installation went fine without little issues, when testing Im not seeing the results im expecting (ie. no image being shown), so I have a couple questions..
When updating the Podfile and running
pod install
, I got the following warningsI didnt fully understand what it meant, but I followed the instructions it suggested and updating the Build Settings as follows..
I ran
pod install
again and the warnings were gone, and the project still compiled without any noticeable issues.I then moved onto step 3 of the
Swift
instructions and updated theNotificationService
class file with the followingand then when I try build I am given this error where
Cannot find 'CustomerIO' in scope
I looked over the instructions again and couldn't figure out where I might have gone wrong. I looked at the
Objective C
steps and noticed that in that step it mentions to includeimport CioTracking
to the file, so I did that to mySwift
step and the error disappeared. Is this a mistake in the documentation, or did I possibly make a mistake somewhere earlier where importingCioTracking
would not be necessary?But after building to my device and testing the Rich Push Notification with an image, I get the notification but no image is included and I cant determine why...
Ive tried to add a break point in the file to see if its doing anything and from what I can tell its not, or at least Im not able to hit the breakpoint due to this message
While my other
PushNotificationsHandler
class file initialises fine (theinitializeCioSdk
line hits without problem on app launch)Im just wondering if maybe it could be spotted where I might be going wrong, or how I could further debug this? If I had to guess it seems like the
NotificationServiceExtension
is not being "loaded", but I really cant tell why this might be the case, or if there's something else that is not working that is preventing the Rich Notifications from working properly.Any help would be greatly appreciated! ☺️ Thanks!
Additional context
Podfile