customerio / cio-sdk-tools

A self service tool to run diagnostics on your mobile SDK installation
MIT License
3 stars 0 forks source link

Notification Service Extension (NSE) not found, but the extension is there? #25

Closed che1404 closed 8 months ago

che1404 commented 1 year ago

Hello and thanks for your command line tool. We are encountering this issue, in which the tool reports that the "Notification Service Extension (NSE) not found", but our extension is there. We are running the command npx cio-sdk-tools@latest doctor and the output is:

image

This is the content of the info.plist of the extension not being found:

image

We have been taking a look at the tool code, and it appears that the function "isNotificationServiceExtension" is returning false, so the extensionCount is not being incremented. We are not JS/TS devs, so we have no idea on how to debug this. However, the if clauses inside the function should evaluate to true, if we understood the code correctly.

Any idea? Thanks!

levibostian commented 1 year ago

👋 Thank you for using the tool! Sorry to hear that you have experienced this. Let me see if I can help.

Could you run the command npx cio-sdk-tools@latest doctor --verbose and report back with the output you received? That extra information could be helpful to see if this is a false positive or not.

che1404 commented 1 year ago

Hi @levibostian , thanks for you reply. It's all on my original post. But here you have the output:

image
levibostian commented 12 months ago

That's helpful, thank you.

The error "Notification Service Extension (NSE) not found" gets thrown when a Notification Service Extension is not configured correctly inside of the Xcode project. It's determined by examining the OOMPH.xcodeproj/project.pbxproj file. Your Info.plist file looks great.

Could you confirm that when you created your new NSE target in Xcode that you embedded the target inside of your host app? Here is an example screenshot of when Xcode asks this question. Notice how the host app is selected in the drop-down:

Figuring out Xcode issues can be difficult. I suggest opening up our sample apps and comparing it's Xcode settings to your project to see if you find differences in the settings.

Lastly, have you tested our the Customer.io SDK inside of your app at runtime? The cio-sdk-tools is a new product and there may be issues discovered in it. There may be a chance that the tool has provided an error to you that may not be valid. I also suggest trying to send yourself a test push with an image attached to it and see if that push (and image) are shown successfully on your iOS device.

I hope this helps. Have an awesome day!

che1404 commented 12 months ago

Hi @levibostian , thanks for your reply! Actually the problem goes away if we remove from our service extension plist tile the following entry:

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>

If we remove it, then the tool succeeds. Is there any way we can use this entry and make the tool succeed? Thanks!

levibostian commented 12 months ago

I am not sure why that modification changed the tool result.

Have you tried comparing your project to the sample apps that I listed above? Have you tried sending yourself a push notification?

levibostian commented 8 months ago

Closing issue due to inactivity.

Feel free to add new comments and we would be happy to re-open and help.