Open sbatezat opened 1 day ago
Hi @sbatezat,
Thank you for reporting this issue. Could you please print or check the values inside presentableFeedbacks
to help us investigate further?
presentableFeedbacks is empty, and retrievedWidgets (= await _channel.invokeMethod('getAvailableFeedbackWidgets')) is too
Thank you for checking that. I’ll investigate this issue and get back to you soon.
If it helps:
Maybe because, according to this changelog, getFeedbackWidget is deprecated on iOS ?
Good observation! However, since the deprecated method uses the same underlying implementation as getAvailableFeedbackWidgets()
, the issue is likely unrelated to that. I’ll continue investigating and update you soon.
Could you please print or check the values of feedbackWidgets.presentableFeedback
on Android as well?
It seems possible that the user you're checking on iOS may have already completed or submitted the available feedback, which could be why no new feedback is being retrieved. Could you try testing with a different device ID?
Unfortunately, I've got only one iOS device. What do you mean by "have already completed or submitted the available feedback"? I have always been able to publish multiple feedback and I've got only one available widget, which has never changed
Each user has a unique device ID. When feedback is submitted, the server marks it as completed and only returns feedbacks that hasn't been completed yet for that user.
Since you mentioned having only one iOS device, you can try reinstalling the app. This will automatically assign a new device ID if you're not explicitly providing one during initialization or changing it after initialization.
If you want to change the device ID without merging, you can use the changeDeviceId
method (which is the recommended approach in your case), as described here:
https://support.countly.com/hc/en-us/articles/34539364044697-Flutter-24-4#h_01H930GAQ682G16Z7M570XKSPD
In new versions we have added setID
method for easier handling, as explained here:
https://support.countly.com/hc/en-us/articles/360037944212-Flutter#h_01H930GAQ682G16Z7M570XKSPD
When feedback is submitted, the server marks it as completed and only returns feedbacks that hasn't been completed yet for that user.
I've got tons of "multiple" feedback for the same user (i'm setting a custom ID), it's working fine (until now, and just broken only on iOS) and it's "my" expected behavior.
Could you please try with different device ID?
Same behavior: a list of available widgets (1) on Android, but an empty list on iOS.
Could you please print or check the values of
feedbackWidgets.presentableFeedback
on Android as well?
It's very weird my users have a unique ID and are using the same widget to send multiple feedback since ever, and you tell me it's not possible. Maybe we are not talking about the same thing? I'm talking about rating widgets.
I don't know if there is other with different rules.
There are three types of feedback widgets (Survey, NPS, and Ratings) Survey and NPS are 1 time only by default, but they can be adjusted to be shown all the time. On the other hand Rating widgets are shown all the time. I have again checked Rating widget on iOS and its working for me.
On the other hand Rating widgets are shown all the time.
Ok! All good on that side 👍
With the same source code, it's working on Android and not on iOS for my app. I'm wondering about this PR https://github.com/Countly/countly-sdk-flutter-bridge/pull/284 if the available widget request is not done with custom header on iOS for any reason. But there is no error message apparently so I doubt it's the issue.
Rating widgets also have the option to set targeting users, could you please verify the targeting users of your rating widget on dashboard?
It's set on "all users". Moreover, i'm working with the same id (my email) on both Android & iOS, so it cannot be link to the user part.
To help diagnose the issue further, could you please try accessing the following URL in your browser by replacing the placeholders with your actual server URL, app key, and device ID?
https://YOUR_SERVER_URL/o/sdk?method=feedback&app_key=YOUR_APP_KEY&device_id=YOUR_DEVICE_ID
Please check the response using both your iOS and Android device IDs separately and share the results. This will help us understand if the server is returning the correct feedback widgets for each device.
My device id is the same for both Android & iOS, so I'll have only one result. Here it is:
{
"result": [
{
"_id": "6555368f72ce854e9c0c453d",
"type": "rating",
"showPolicy": "afterPageLoad",
"appearance": {
"position": "mleft",
"bg_color": "#123456",
"text_color": "#fff",
"text": "Retour d'expérience",
"size": "m",
"hideS": true
},
"tg": [
"/"
],
"name": "Donnez-nous votre avis !"
}
]
}
Great!, response looks ok Can you please check that URL with the device ID you had changed (without merge) for iOS?
My device id is the same for both Android & iOS for months
Would it be possible for you to open your iOS project in Xcode and add a breakpoint at line 506 in the CountlyFeedbacksInternal.m
file? Please check and share the values of request and the constructed URL at that point. This will help us verify if the request is being formed correctly.
The request seems to be fine.
I've found the origin. My API Management in front of Countly instance is returning 403.
There is an error field populated on iOS part but not on Flutter side.
I'm looking for request details to see if my custom header (needed by my API Management) is set, but probably not.
Ok, I can confirm it's an issue with #284
There is a "nil" on NSURLSession.sharedSession.configuration.HTTPAdditionalHeaders... Updating manually the task like this is working fine:
Of course, I've called config.setCustomNetworkRequestHeaders(headers);
@ijunaid could you please confirm it's an iOS issue and ask the iOS team to fix it?
Whatever, I keep this issue opened, as Flutter Countly is using a deprecated method AND do not log iOS error on that case
@sbatezat, thanks for the update. I’ll discuss this internally with the team and work on fixing the issue.
AvailableFeedbackWidgets not working anymore on iOS
empty is returning false on Android (this is ok) and true on iOS
It was working previously and I'm still looking for the root cause...