-
Notifications
You must be signed in to change notification settings - Fork 9
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
3rd party SDKs not able to receive a device token with autoFetchDeviceToken
enabled
#131
Comments
Sorry to hear you're having issues, Samox. Let me see if we can help. Here are some questions and comments that I have to help debug this.
|
Oh, sorry for the issue being auto-closed. I'm new to using Linear. |
Hello thanks for your quick response!
if (Device.isDevice) {
const { status: existingStatus } = await Notifications.getPermissionsAsync();
let finalStatus = existingStatus;
if (existingStatus !== 'granted') {
const { status } = await Notifications.requestPermissionsAsync();
finalStatus = status;
}
if (finalStatus !== 'granted') {
console.warn('Failed to get push token for push notification!', finalStatus);
}
console.log('This works', finalStatus);
const expoPushToken = await Notifications.getExpoPushTokenAsync({
projectId: Constants.expoConfig.extra.eas.projectId,
}); -> We are stuck here. Promise is not resolved, and does not throw either
console.log(`Push token: ${expoPushToken.data}`); Some more info:
|
Thank you for all of that info. Very helpful! For the next step of debugging, we would like to review these files from your
It's understandable that some of these files have sensitive information inside of it. Feel free to send those files to |
Info sent by email :) |
+1, same problem with Expo SDK 49, I am not able to access notification content when it is received or tapped and neither to access the push token (even if it seems to be successfully sent to Customer.IO, I cannot manage logging it) |
Thank you for sending that information, Samox. I can confirm that I have received the files. Our team will dig into this deeper, trying to reproduce the issue. We'll come back if we have more questions or comments. |
@simontoulouze, sorry to hear that you have been experiencing an issue. If you don't mind, could you open a new issue and describe the behavior the you're experiencing? The expected behavior you expect to see as well as actual behavior you're getting? Code snippets showcasing what you're trying to accomplish is also very helpful. We would be happy to review this for you. |
Samox, have you used customer.io in your app before or is this a new install? If you have used customer.io before, what version of the Expo plugin have you tried? What versions gave you a token successfully and what versions did not give you a token? I am not sure if you're using a bare or managed workflow. If you're able to, could you try to modify your file // In this file, leave everything else the same. Only modify this 1 line.
MessagingPushAPN.initialize { config in
// Add this line of code:
config.autoFetchDeviceToken = false
}
} Thank you for working with me to debug this. We are continuing to try and reproduce this from our end. Any answers you can provide here will help expedite being able to figure out the issue. |
Yeah I did not want to make it more complex, but the first time I installed the plugin (2 weeks ago) it worked perfectly, then last week it did not. I don't now what changed. I tried to reproduce the case when it worked, but I was unable to, and became crazy. We have a managed installation with expo. I'll try a build with the line |
🎉🎉🎉🎉 It changes my workflow though since I need to prebuild the ios folder, do you think you can release a fix soon ? What is the impact of |
I opened this PR #132 to properly configure the plugin |
Glad to hear that the
The reason that this config option is not exposed as an Expo plugin config option is that you should not need to modify this config option. If you feel the need to change this option, it is probably because there is a problem with the SDK or your app's setup of the Customer.io SDK. I suggest continuing to use the patch that you have developed. We'll look into this deeper and provide a fix to fix this without a patch needed. Thanks again for working with me to debug this issue! |
autoFetchDeviceToken
enabled
Hi! thanks for this info, I have been a bit blocked since we updated to the beta 15 because of this... I'm having the same issue with expo notifications and I have been trying these two to get along for quite some months already. It is not clear to me where to add @Samox's workaround, is it in the plugins on app.config? inside ios or inside pushNotification? Perhaps in the env object? I'm using the managed flow on expo... Thanks in advance! |
Sorry to hear you're experiencing this issue, @LeonRueda. Great question. Let me try and help. You're looking for the file specified in this comment. So, a Swift file that's located in your I understand that this is not ideal. Continue asking questions if you have them! |
My workaround was
|
I've spent 12hrs troubleshooting this error 🤕 . I'm thinking I'll resolve to remove customerio entirely. Patching with Would be great to see this resolved |
Sorry to hear you have encountered this issue, @jordiup. Because you mentioned that setting
It's understandable that some of these files have sensitive information inside of it. Feel free to send those files to |
Experiencing the same issue. This issue was incredibly hard to debug and I imagine most people on Expo 48+ will experience it. @levibostian have you still not been able to reproduce it? We are running a managed workflow with Expo 50. The issue arose after migrating up from Expo 48, where it worked fine with the Customer.io plugin. When removing the Customer.io plugin from our build, we are able to get the device token just fine from Expo Notifications, using the recommended setup from Expo documentation. Patching the package with I believe the easiest way to replicate the issue is to simply spin up a managed Expo 50 app, integrate Expo Notifications and the latest version of this package, and trying to run The solution I found for our case was using |
Thank you very much for this additional detail, Louie. We greatly appreciate it. The solution that you mention is a good idea. Thanks for mentioning that for others.
I am very curious why this config change didn't help you. Do you have a sample app available that reproduces this? I am very interested in hearing more about this. Thank you for debugging this issue with us, everyone. I agree, this issue has been hard to debug and so any additional code or details is appreciated. |
Hi, Same issue here. Spent tons of hours trying to find the problem...
Please let us know once a new version with a fix is released! |
Thank you for sharing setting the config to false solved the problem for you. We appreciate the time you've spent trying to resolve the issue. Sorry that this issue has caused frustration for yourself and others. Rest assured, our team is actively working to resolve this issue and we will notify you once a new version with a fix is released. |
They have been promising a fix for this for ages. Yet nothing changes. |
+1 to #131 (comment) I request push tokens to sync to other 3rd party providers, and for new push tokens (i.e. the app just opened), |
also +1 to #131 (comment) 🎉 I am using a managed workflow and I patch (using patch-package) it like this 👇
MessagingPushAPN.initialize { config in
config.showPushAppInForeground = {{SHOW_PUSH_APP_IN_FOREGROUND}}
}
MessagingPushAPN.initialize { config in
config.autoFetchDeviceToken = false
config.showPushAppInForeground = {{SHOW_PUSH_APP_IN_FOREGROUND}}
}
A customerio-expo-plugin patch file has normally been created ! |
Hi, I am running a managed workflow with Expo 50 too and I've had the same problem recently. But with the line Someone with a problem like this founded some solution? |
Hello @ami-aman @levibostian - is there a timeline for improving the experience for users affected by this issue? Either by exposing the |
Issue causing 3rd party SDKs, like Expo notifications, not receiving device tokens when registered to the device, contrary to expected behavior.
Expected Outcome
autoFetchDeviceToken
.Current Outcome
Impact on Customers
Debugging
In UIKit sample app, I added this code block to the AppDelegate.swift file:
When setting a breakpoint in that function, the breakpoint does not get triggered. I expected to see this behavior because looking at the swizzling code when a device token is registered to the CIO SDK, the function that gets called by swizzling does not call the original implementation that swizzling replaced.
I believe this is the issue. If the AppDelegate breakpoint does not get triggered, 3rd party SDKs are also not getting called with the device token.
I found a Swift swizzling implementation from another open source SDK on github. Could be a good resource for us to find a working Swizzling implementation for register device tokens.
References
The text was updated successfully, but these errors were encountered: