Closed savy-91 closed 2 years ago
If in the future anybody else has this problem, this is the workaround I am using.
I created a transformation that, given an event setDeviceToken
runs this function:
export async function setCustomerIoToken(event) {
const customer_id = event.userId;
const token = event.properties['$token'];
const requestUrl = `https://track-eu.customer.io/api/v1/customers/${customer_id}/devices`;
const os = 'android';
const auth = 'AUTH_STRING'
const payload = {
"device": {
"id": token,
"platform": 'android'
}
};
const res = await fetch(requestUrl, {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${auth}`,
},
body: JSON.stringify(payload),
});
return res;
}
I see you guys are working on this in #33 :rocket:
Hi @savy-91 we already supported this annonymousId fix in this https://github.com/rudderlabs/rudder-sdk-flutter/pull/33
Hi!
I am setting up an integration with customer.io and therefore I'd like to push the device token there as well.
The issue I am having is that despite setting the device token correctly after initialization, the AppOpen event is not sent with the device token.
Here is an example of event sent by the Flutter SDK:
This is the subsequent event that gets sent:
It seems to me that the Application Open event is sent before the token is set.
The documentation states:
Which is what I am doing.
The problem persists after subsequent app restarts, therefore I assume that the token is not persisted by the Rudder sdk.
The additional problem is that due to the way Rudderstack integrates with Customer.io, there is no way for me to register the fcm token at a later stage as:
It would be great if you could have a look at this as I believe it could be a bug in the Rudderstack SDK for Flutter and as a temporary solution it could also work if I could manually send the device token to Customer.io in a separate event.