Closed fdobre closed 1 year ago
Hello @fdobre , Thanks for the message, we'll check this issue with our team.
Have a nice day
Hello @fdobre, thank you for your report. From the screenshot log it looks like your "Fetch" API is undefined. it looks like some other code is overriding global.fetch
function. Could you please check if fetch
is available in your project without Flagship.
Good to Know: In React-Native, the Fetch
api can be undefined if you run your application in test with jest for example
@Heihokon yes, the global fetch is rewritten to add some extra logs in dev mode:
// https://stackoverflow.com/questions/33997443/how-can-i-view-network-requests-for-debugging-in-react-native
// To see all the requests in the chrome Dev tools in the network tab.
XMLHttpRequest = global.originalXMLHttpRequest
? global.originalXMLHttpRequest
: global.XMLHttpRequest;
// fetch logger
global._fetch = fetch;
global.fetch = function (uri, options, ...args) {
return global._fetch(uri, options, ...args).then(response => {
console.log('Fetch', { request: { uri, options, ...args }, response });
return response;
});
};
}
We haven't had any issues with this until now ....
I have removed the overwrite from above but get the same errors. I don't think that is the cause...
FYI:
flagship.fetchFlags()
succeeds and responds with undefined but the above FETCH and onReady errors are still present.
console.log(' FLAGS FETCH TRIGGERED IN WRAPPER');
try {
flagship
.fetchFlags()
.then(flags => {
console.log('FLAGS FETCHED, RESPONSE IS ', flags);
})
.catch(err => {
console.log('FLAGSHIP FLAGS FECH ERROR', err);
});
} catch (err){
console.log('CAUGHT FLAGS FETCH ERROR', err);
}
}, [flagship]);
Please let me know if any additional debug data is needed.
Hello @fdobre,
Thanks for your feedback, we tested your code in a project from scratch, it seems everything works fine. We only reproduce this issue if we set global.fetch
to undefined
before the Flagship import, for example in index.js
. it seems that at some point global.fetch
is undefined
and then becomes defined.
Could you install flagship sdk like this yarn add @flagship.io/react-native-sdk@alpha
or npm i @flagship.io/react-native-sdk@alpha
. and check if the issue is still going on.
Thanks
@Heihokon I tried @flagship.io/react-native-sdk@alpha
but got same error.
Tried to set a new project and got into: https://github.com/flagship-io/flagship-react-native-sdk/issues/63
Does the library support a react-native-cli project?
I can confirm that in a new basic project using RN 0.69.6 issue cannot be replicated.
It has to be some metro or babel setting or something that makes it undefined before the imports.
Investigating...
Added more logs in Flagship code:
======FLAGSHIP STATUS CHANGED TO====== 1
LOG FLAGSHIP STATUS CHANGED, FETCH IS function
LOG === Flagship init start ===
DEBUG [2023-01-03 19:07:33.909] [Flagship SDK] [DEBUG] [INITIALIZATION] : Flagship SDK version 3.1.0 is starting in DECISION-API mode with config {"_trackingMangerConfig":{"_batchIntervals":5,"_poolMaxSize":50,"_batchStrategy":0},"_decisionApiUrl":"https://decision.flagship.io/v2/","_envId":"cdltkb2b2oo0tjktjdbg","_apiKey":"DgMQYQEYcjmDkYFbFnbarvTCgsVkklmBAEornOlE","_logLevel":9,"_timeout":2,"_fetchNow":true,"_enableClientCache":true,"_decisionMode":"DECISION-API","_hitDeduplicationTime":2,"_disableCache":false,"_visitorCacheImplementation":{},"_hitCacheImplementation":{},"_logManager":{}}
INFO [2023-01-03 19:07:33.915] [Flagship SDK] [INFO] [SDK STATUS] : SDK status has changed: READY
INFO [2023-01-03 19:07:33.916] [Flagship SDK] [INFO] [startBatchingLoop] : Batching Loop have been started
LOG
======FLAGSHIP STATUS CHANGED TO====== 4
LOG FLAGSHIP STATUS CHANGED, FETCH IS function
LOG === Flagship init done ===
INFO [2023-01-03 19:07:33.918] [Flagship SDK] [INFO] [INITIALIZATION] : Flagship SDK (version: 3.1.0) READY
LOG useFlagship NO USER ID DETECTED undefined
LOG
FLAGSHIP FLAGS FETCHED undefined
DEBUG [2023-01-03 19:07:33.929] [Flagship SDK] [DEBUG] [LOOKUP HIT] : Hits data has been loaded from database: {"11b7b4dc-89cc-4c78-a93c-1a770b34e ...
DEBUG [2023-01-03 19:07:33.938] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor identifier is empty. A UUID b5ceb9a2-d6de-44a1-a94f-630ebd5856ae has been generated.
DEBUG [2023-01-03 19:07:33.940] [Flagship SDK] [DEBUG] [UPDATE CONTEXT] : visitor `b5ceb9a2-d6de-44a1-a94f-630ebd5856ae`, context have been updated: key/value {"language":"en","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}, Context {"fs_client":"React-Native","fs_version":"3.1.0","fs_users":"b5ceb9a2-d6de-44a1-a94f-630ebd5856ae","language":"en","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}
DEBUG [2023-01-03 19:07:33.941] [Flagship SDK] [DEBUG] [NEW VISITOR] : Predefined Context have been loaded {"fs_client":"React-Native","fs_version":"3.1.0","fs_users":"b5ceb9a2-d6de-44a1-a94f-630ebd5856ae"}
DEBUG [2023-01-03 19:07:33.944] [Flagship SDK] [DEBUG] [SET_CONSENT] : Visitor `b5ceb9a2-d6de-44a1-a94f-630ebd5856ae` consent has been changed : true
DEBUG [2023-01-03 19:07:33.945] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor undefined has been created with context {"language":"en","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}, isAuthenticated:false and hasConsented true
DEBUG [2023-01-03 19:07:33.946] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor b5ceb9a2-d6de-44a1-a94f-630ebd5856ae has been saved in SDK instance
DEBUG [2023-01-03 19:07:33.953] [Flagship SDK] [DEBUG] [FETCH_FLAGS] : visitor `b5ceb9a2-d6de-44a1-a94f-630ebd5856ae` fetchFlags process is started
LOG TYPEOF FETCH function
LOG TYPEOF this.getResponse function
ERROR [2023-01-03 19:07:33.963] [Flagship SDK] [ERROR] [FETCH_FLAGS] : undefined is not a function
LOG created visitor, error is {}
LOG VISITOR READY [TypeError: undefined is not a function]
ERROR [2023-01-03 19:07:33.968] [Flagship SDK] [ERROR] [onReady] : undefined is not a function
DEBUG [2023-01-03 19:07:33.970] [Flagship SDK] [DEBUG] [FETCH_FLAGS] : Visitor b5ceb9a2-d6de-44a1-a94f-630ebd5856ae, anonymousId null with context {"fs_client":"React-Native","fs_version":"3.1.0","fs_users":"b5ceb9a2-d6de-44a1-a94f-630ebd5856ae","language":"en","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false} has just fetched flags [] from Campaigns
DEBUG [2023-01-03 19:07:33.974] [Flagship SDK] [DEBUG] [FLUSH HIT] : The following hit keys have been flushed from database : ["11b7b4dc-89cc-4c78-a93c-1a770b34e4f2:795b2ec3-f9d9-4dff-9b9a-7f35e0f0ead4","7c914d83-e958-40c9-8e96-4a7507e3bbe5:125b9499-954d-4e85-b12d-820b9e04327f","e449c57b-bad5-4a8c-926a-710cc950545e:c0a1f554-a465-43b8-9691-70c2e603cf32","0518d982-f4b1-4f27-a74f-a42ec2bb4455:b36f7575-ec51-4c0c-b45f-bf0837eb0814","a5ea61af-ba08-415f-aa98-777a67088344:68239c27-78a1-4952-8ca4-21680419d1fe","00266dbf-9ad5-4c3c-91d3-54e38aaba2b7:34da4c88-cc72-4155-8e9c-2074cc1f6edb","29f5f5ea-b059-4704-9062-35d6e7f6a8d7:25a69f34-ace2-403e-94e5-2a9f28181fbc","58fb1106-c011-4a27-ba00-ba099c675a9a:c4759a80-f74b-4283-b9e5-76195e1d734c","5bf2bc4f-fa8d-44f1-8718-ceeb8351bf21:edac9363-7d0f-41c5-b260-d61558cd7509","8c401e1b-6b60-4bbf-9ae0-5706abad1ca1:b31b25c1-daca-4105-ae04-263c8cc335e3","da054bc5-5da7-41a7-b10a-99f66eeb37f0:46b52cfc-20ca-47df-9826-ea4cb5dd720a","01394d38-f469-4242-8f1a-878bdd93e236:8c6fe43b-44c6-45af-90de-81cb87035110","2b45b2cf-ddba-41a3-814c-f1b0e233815a:66fe84d4-fcd4-4754-8d9d-228a96003914","c745f4d6-ec98-4ff3-bf27-b875535898cc:0f60babb-8323-4609-a269-31ccdfbccf29","5d9d32dd-a59d-4a08-ba43-94fdf5735d7e:d113b0f7-a17e-44e6-8184-39b50abfa133","8bc8e83b-9f61-40e0-a547-3a053c67fd8e:371daa8e-8d78-418a-83a9-612d0d4bc00c","e1c7702d-ed10-4131-a5af-3d433319803a:4ade6f8b-ea32-44e5-bada-24151e077cf7","e8567204-c550-42f6-9d25-0c4bb1dbde24:639a4a63-8c75-4ca9-b8f9-2010a3021a83","50689384-fde5-4521-ac80-39f6907c42f5:0280f83a-7055-4b7f-b6c8-5979eff35229","9c82e866-f5c8-492f-a98f-b26817de285d:c485b45a-d011-425c-b160-fb523ebccfc8","8a821204-2c93-43c6-b84e-6ec9dcb2ecbc:bd2d5ae1-25a1-405d-86b3-392f6ee28d4f","5924a9e6-76cc-4a01-8e32-ec555c205d72:bed3a252-919e-4861-83d1-0d07e453f960","8c2ab5c1-62b1-45d4-89b9-b749df9d9195:fa5ff554-80db-4cb7-90c1-41d20e55eac7","1b6a88d0-c060-4286-a4ef-bf5a3e9cd215:97230311-0710-4ff4-9a44-7fd2b458b031","7213329d-2844-4a04-9341-7cc959554d1f:8983d84f-aecb-41d4-824d-731f61ad7eca","c31c3c08-2c6d-4e34-ad8d-9f74cac34d32:e359e1ba-cc61-43b2-8670-71e237dd9b0c","7c470dc9-54fa-4148-b628-6ea920f0f30f:6969d419-c7c4-4282-958f-16140bbf2f04","7eeb34e8-acf1-434e-b5ea-a8b3420b6280:f2fe214a-b0f7-4dc9-83d8-a547b681f48d","a5d1c60d-7114-4386-a675-cde8cd6edbf3:41d9c7eb-c2d6-487f-946c-1b756f43ca12","5dd4e270-2ae4-408b-b9ea-ecce9c320f24:91fe4897-3623-4bff-9234-ec5dd49d384c","3e50ad4a-165d-4345-be48-6c8442c4871e:9313e0f9-00c3-4d7d-9e21-664df6f85fa3","ec74164d-60bb-4339-8976-a75e5a6039a6:9f480f3d-61d0-4849-8628-bd844276cdca","db3de36a-de87-4b3e-8eb1-bdd7b4251ab1:e458199c-de73-4b4c-a563-146d888d584e","5d451bf2-2a84-4978-b367-d8f98d27ff84:ac234ceb-1ac0-45e8-8324-92778da52815","320ce6d8-2b04-42d2-8d37-7568d52a19d1:ac1149bb-763b-4d97-8ac5-57bce78bd974","06903982-46d1-48d4-87a4-f6d0df035f4f:0e7cc05d-3679-408c-98b2-27b816d7208e","d8a9862f-a2da-4ebf-9bc5-f50d73f2eff7:5997e044-23dd-46fb-880f-c2a1bc17c815","6a6ba185-eb57-4b6d-8361-b1ccad3b48ed:88c7d1fd-bf67-4c67-939c-576e81f4069d","e51f4311-e4eb-4e6b-a6f8-2378b6c7d109:db890a37-0b48-4b96-97f3-9ea52044a8cb"]
DEBUG [2023-01-03 19:07:33.975] [Flagship SDK] [DEBUG] [CACHE HIT] : Hit data has been saved into database : {"b5ceb9a2-d6de-44a1-a94f-630ebd5856ae:4fe9929e-91b2-4e90-bee5-d529c7acbcc5":{"version":1,"data":{"visitorId":"b5ceb9a2-d6de-44a1-a94f-630ebd5856ae","anonymousId":null,"type":"EVENT","content":{"key":"b5ceb9a2-d6de-44a1-a94f-630ebd5856ae:4fe9929e-91b2-4e90-bee5-d529c7acbcc5","visitorId":"b5ceb9a2-d6de-44a1-a94f-630ebd5856ae","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675271253942,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675271253943}}}
DEBUG [2023-01-03 19:07:33.976] [Flagship SDK] [DEBUG] [ADD HIT] : The HIT has been added to the pool queue : {"vid":"b5ceb9a2-d6de-44a1-a94f-630ebd5856ae","ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"EVENT","cuid":null,"qt":34,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"}
LOG GOT RESPONSE RETURNING {"body": {"campaigns": [], "visitorId": "b5ceb9a2-d6de-44a1-a94f-630ebd5856ae"}, "headers": {"access-control-allow-headers": "Content-Type,Authorization,X-Api-Key,X-Sdk-Client,X-Sdk-Version,X-Pop", "access-control-allow-methods": "GET, POST, OPTIONS", "access-control-allow-origin": "*", "access-control-max-age": "7200", "content-encoding": "gzip", "content-type": "application/json", "date": "Wed, 01 Feb 2023 17:07:34 GMT", "server": "nginx", "vary": "Accept-Encoding", "x-cache": "miss", "x-pop": "eu-west-3", "x-proxy-version": "1.0.55", "x-ratelimit-limit": "100", "x-ratelimit-remaining": "98", "x-ratelimit-reset": "1", "x-request-quota-remaining": "999861"}, "status": 200}
LOG TYPEOF FETCH function
LOG TYPEOF this.getResponse function
ERROR [2023-01-03 19:07:38.932] [Flagship SDK] [ERROR] [SEND BATCH] : {"message":"undefined is not a function","data":{"url":"https://events.flagship.io","headers":{"Content-Type":"application/json"},"body":{"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":9,"h":[{"vid":"56800cf5-5322-43f4-9241-73c031a90e06","t":"EVENT","cuid":null,"qt":14287285,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"ec54a34a-0bf1-4e29-9e17-58f7133491d3","t":"EVENT","cuid":null,"qt":14032255,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"fd636125-b1fe-4024-9ca3-dd86174a01e8","t":"EVENT","cuid":null,"qt":13773407,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"3edf527a-c255-4865-8def-7d91f1af09ed","t":"EVENT","cuid":null,"qt":13549077,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"36a22b09-fd79-4ec8-80ad-3527c8ea781f","t":"EVENT","cuid":null,"qt":13516174,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"6c8bc23d-335f-46fa-9dc1-1124a72322b4","t":"EVENT","cuid":null,"qt":13492025,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"3712ef38-8165-444a-ac67-1d0dd0f97b60","t":"EVENT","cuid":null,"qt":13487615,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"6abd2f2e-4ae8-4240-a7ac-27d43ce562b3","t":"EVENT","cuid":null,"qt":13432503,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"11b68709-399b-44ff-a117-df12841aac49","t":"EVENT","cuid":null,"qt":13427105,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"6fa32fa7-11d0-43b5-9b02-ec2869d010d7","t":"EVENT","cuid":null,"qt":13132081,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"b8e59fdd-ce3d-4105-a758-cbf683590da4","t":"EVENT","cuid":null,"qt":13067497,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"3596b22b-3514-43d8-8e51-c6164683f6b0","t":"EVENT","cuid":null,"qt":13063209,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"455b002c-4316-4f0e-a752-6268be450662","t":"EVENT","cuid":null,"qt":13060533,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"f54266db-442b-4714-8c39-941df2dd6b41","t":"EVENT","cuid":null,"qt":2600312,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"58dac75c-d7dd-47c5-951b-62a13566d873","t":"EVENT","cuid":null,"qt":2065266,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"e4ee0928-524c-4f38-9512-ba5a20f7aa8e","t":"EVENT","cuid":null,"qt":2043663,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"c499ff60-6f16-4056-95c7-9e86ef98dc7f","t":"EVENT","cuid":null,"qt":1783498,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"7c8aee86-cc02-4dbf-bb9e-6388700750c5","t":"EVENT","cuid":null,"qt":1754907,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"54d39f30-1286-4775-9387-d4bc0cb33a70","t":"EVENT","cuid":null,"qt":1741805,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"f4dcb6cb-c195-48f3-a14b-86023e4f35a7","t":"EVENT","cuid":null,"qt":1556270,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"cb5a984d-0ec8-4e28-ac2e-f635cb35da5e","t":"EVENT","cuid":null,"qt":1540427,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"77838093-01a1-4914-89c7-b641e7cff676","t":"EVENT","cuid":null,"qt":1534828,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"777f7606-ba54-438b-a726-cd7ff5ac03cd","t":"EVENT","cuid":null,"qt":1511814,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"29bf6955-235c-45ca-be12-e01da9e13f10","t":"EVENT","cuid":null,"qt":1466762,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"a37fe157-32b4-4960-be2a-27e977825212","t":"EVENT","cuid":null,"qt":1360028,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"0dbfe518-efb6-47da-97ae-eaa31f754550","t":"EVENT","cuid":null,"qt":1209607,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"6941bc52-6583-42a6-98cd-dbb51656f0e4","t":"EVENT","cuid":null,"qt":1048709,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"83bdd487-da9f-4378-a861-03372f8f8651","t":"EVENT","cuid":null,"qt":987455,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"d13f5ea0-d106-4201-8c6d-955db7114cfa","t":"EVENT","cuid":null,"qt":786809,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"8ba27aaf-ffb7-408a-9ba0-e97a2dac63d2","t":"EVENT","cuid":null,"qt":726866,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"483aca1f-1879-4f2b-810d-44a00de972af","t":"EVENT","cuid":null,"qt":558860,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"584f34a6-0a4e-4333-a5be-ec57fbc57b4b","t":"EVENT","cuid":null,"qt":469620,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"0e2d74b7-7f04-4608-8c9a-d69aa7a1e8a8","t":"EVENT","cuid":null,"qt":416676,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"3a3eb784-e1e6-43f6-9955-49d954301c5c","t":"EVENT","cuid":null,"qt":329751,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"96fbb551-8fc6-438f-bc05-1233da916a8b","t":"EVENT","cuid":null,"qt":247068,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"7ed844e6-a467-490d-b389-05bea0fea2e7","t":"EVENT","cuid":null,"qt":130660,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"a5b201f7-d04b-477a-b049-58ae18158f14","t":"EVENT","cuid":null,"qt":12199,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"b5ceb9a2-d6de-44a1-a94f-630ebd5856ae","t":"EVENT","cuid":null,"qt":4989,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"}]},"duration":1,"batchTriggeredBy":"Timer"}}
LOG GOT RESPONSE RETURNING {"body": undefined, "headers": {"access-control-allow-credentials": "true", "access-control-allow-headers": "Content-Type,Origin,Accept,Set-Cookie,X-ABTasty-CrossDomain", "access-control-allow-methods": "GET,HEAD,POST", "access-control-allow-origin": "*", "alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", "cache-control": "must-revalidate, no-cache, private", "content-length": "43", "content-type": "image/gif", "date": "Wed, 01 Feb 2023 17:07:39 GMT", "server": "-", "strict-transport-security": "max-age=31536000; includeSubDomains", "via": "1.1 google", "x-envoy-decorator-operation": "-", "x-envoy-upstream-service-time": "4"}, "status": 200}
LOG TYPEOF FETCH function
LOG TYPEOF this.getResponse function
ERROR [2023-01-03 19:07:43.931] [Flagship SDK] [ERROR] [SEND BATCH] : {"message":"undefined is not a function","data":{"url":"https://events.flagship.io","headers":{"Content-Type":"application/json"},"body":{"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":10,"h":[{"vid":"56800cf5-5322-43f4-9241-73c031a90e06","t":"EVENT","cuid":null,"qt":14292285,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"ec54a34a-0bf1-4e29-9e17-58f7133491d3","t":"EVENT","cuid":null,"qt":14037255,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"fd636125-b1fe-4024-9ca3-dd86174a01e8","t":"EVENT","cuid":null,"qt":13778407,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"3edf527a-c255-4865-8def-7d91f1af09ed","t":"EVENT","cuid":null,"qt":13554077,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"36a22b09-fd79-4ec8-80ad-3527c8ea781f","t":"EVENT","cuid":null,"qt":13521173,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"6c8bc23d-335f-46fa-9dc1-1124a72322b4","t":"EVENT","cuid":null,"qt":13497024,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"3712ef38-8165-444a-ac67-1d0dd0f97b60","t":"EVENT","cuid":null,"qt":13492614,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"6abd2f2e-4ae8-4240-a7ac-27d43ce562b3","t":"EVENT","cuid":null,"qt":13437502,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"11b68709-399b-44ff-a117-df12841aac49","t":"EVENT","cuid":null,"qt":13432104,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"6fa32fa7-11d0-43b5-9b02-ec2869d010d7","t":"EVENT","cuid":null,"qt":13137080,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"b8e59fdd-ce3d-4105-a758-cbf683590da4","t":"EVENT","cuid":null,"qt":13072496,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"3596b22b-3514-43d8-8e51-c6164683f6b0","t":"EVENT","cuid":null,"qt":13068208,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"455b002c-4316-4f0e-a752-6268be450662","t":"EVENT","cuid":null,"qt":13065532,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"f54266db-442b-4714-8c39-941df2dd6b41","t":"EVENT","cuid":null,"qt":2605311,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"58dac75c-d7dd-47c5-951b-62a13566d873","t":"EVENT","cuid":null,"qt":2070265,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"e4ee0928-524c-4f38-9512-ba5a20f7aa8e","t":"EVENT","cuid":null,"qt":2048662,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"c499ff60-6f16-4056-95c7-9e86ef98dc7f","t":"EVENT","cuid":null,"qt":1788497,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"7c8aee86-cc02-4dbf-bb9e-6388700750c5","t":"EVENT","cuid":null,"qt":1759906,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"54d39f30-1286-4775-9387-d4bc0cb33a70","t":"EVENT","cuid":null,"qt":1746804,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"f4dcb6cb-c195-48f3-a14b-86023e4f35a7","t":"EVENT","cuid":null,"qt":1561269,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"cb5a984d-0ec8-4e28-ac2e-f635cb35da5e","t":"EVENT","cuid":null,"qt":1545426,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"77838093-01a1-4914-89c7-b641e7cff676","t":"EVENT","cuid":null,"qt":1539827,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"777f7606-ba54-438b-a726-cd7ff5ac03cd","t":"EVENT","cuid":null,"qt":1516813,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"29bf6955-235c-45ca-be12-e01da9e13f10","t":"EVENT","cuid":null,"qt":1471761,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"a37fe157-32b4-4960-be2a-27e977825212","t":"EVENT","cuid":null,"qt":1365027,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"0dbfe518-efb6-47da-97ae-eaa31f754550","t":"EVENT","cuid":null,"qt":1214606,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"6941bc52-6583-42a6-98cd-dbb51656f0e4","t":"EVENT","cuid":null,"qt":1053709,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"83bdd487-da9f-4378-a861-03372f8f8651","t":"EVENT","cuid":null,"qt":992455,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"d13f5ea0-d106-4201-8c6d-955db7114cfa","t":"EVENT","cuid":null,"qt":791809,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"8ba27aaf-ffb7-408a-9ba0-e97a2dac63d2","t":"EVENT","cuid":null,"qt":731866,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"483aca1f-1879-4f2b-810d-44a00de972af","t":"EVENT","cuid":null,"qt":563860,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"584f34a6-0a4e-4333-a5be-ec57fbc57b4b","t":"EVENT","cuid":null,"qt":474620,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"0e2d74b7-7f04-4608-8c9a-d69aa7a1e8a8","t":"EVENT","cuid":null,"qt":421676,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"3a3eb784-e1e6-43f6-9955-49d954301c5c","t":"EVENT","cuid":null,"qt":334751,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"96fbb551-8fc6-438f-bc05-1233da916a8b","t":"EVENT","cuid":null,"qt":252068,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"7ed844e6-a467-490d-b389-05bea0fea2e7","t":"EVENT","cuid":null,"qt":135660,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"a5b201f7-d04b-477a-b049-58ae18158f14","t":"EVENT","cuid":null,"qt":17199,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"b5ceb9a2-d6de-44a1-a94f-630ebd5856ae","t":"EVENT","cuid":null,"qt":9988,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"}]},"duration":1,"batchTriggeredBy":"Timer"}}
LOG GOT RESPONSE RETURNING {"body": undefined, "headers": {"access-control-allow-credentials": "true", "access-control-allow-headers": "Content-Type,Origin,Accept,Set-Cookie,X-ABTasty-CrossDomain", "access-control-allow-methods": "GET,HEAD,POST", "access-control-allow-origin": "*", "alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", "cache-control": "must-revalidate, no-cache, private", "content-length": "43", "content-type": "image/gif", "date": "Wed, 01 Feb 2023 17:07:44 GMT", "server": "-", "strict-transport-security": "max-age=31536000; includeSubDomains", "via": "1.1 google", "x-envoy-decorator-operation": "-", "x-envoy-upstream-service-time": "4"}, "status": 200}
LOG TYPEOF FETCH function
LOG TYPEOF this.getResponse function
Fetch is always there and all responses are 200 OK.
Maybe some visitor config cache issue?
Are you sure fetch undefined is the cause?
All the send batch are 200 and still send batch error.....
Thanks a lot for your support!
More error info (stacktrace included):
LOG FLAGSHIP STATUS CHANGED, FETCH IS function
LOG === Flagship init done ===
INFO [2023-01-03 19:39:57.619] [Flagship SDK] [INFO] [INITIALIZATION] : Flagship SDK (version: 3.1.0) READY
LOG useFlagship NO USER ID DETECTED undefined
LOG
FLAGSHIP FLAGS FETCHED undefined
DEBUG [2023-01-03 19:39:57.628] [Flagship SDK] [DEBUG] [LOOKUP HIT] : Hits data has been loaded from database: {"f79aecea-d925-4871-a7f8-b86d1dec4277:cc59960a-e502-4bbf-9cec-a2f17818c31e":{"version":1,"data":{"visitorId":"f79aecea-d925-4871-a7f8-b86d1dec4277","anonymousId":null,"type":"EVENT","content":{"key":"f79aecea-d925-4871-a7f8-b86d1dec4277:cc59960a-e502-4bbf-9cec-a2f17818c31e","visitorId":"f79aecea-d925-4871-a7f8-b86d1dec4277","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675272134582,"category":"User Engagement","action":"fs_consent","label":"React-Native:false"},"time":1675272134583}},"4359a6c9-b52d-4413-8e6b-3cd55291b357:54726c98-fc8e-4d07-b59d-d016ac117b89":{"version":1,"data":{"visitorId":"4359a6c9-b52d-4413-8e6b-3cd55291b357","anonymousId":null,"type":"EVENT","content":{"key":"4359a6c9-b52d-4413-8e6b-3cd55291b357:54726c98-fc8e-4d07-b59d-d016ac117b89","visitorId":"4359a6c9-b52d-4413-8e6b-3cd55291b357","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675272162818,"category":"User Engagement","action":"fs_consent","label":"React-Native:false"},"time":1675272162819}},"979bcd40-8f1c-4beb-aee6-a7870d0b11e0:1d88948c-8d92-4803-bdc8-70691bc87c77":{"version":1,"data":{"visitorId":"979bcd40-8f1c-4beb-aee6-a7870d0b11e0","anonymousId":null,"type":"EVENT","content":{"key":"979bcd40-8f1c-4beb-aee6-a7870d0b11e0:1d88948c-8d92-4803-bdc8-70691bc87c77","visitorId":"979bcd40-8f1c-4beb-aee6-a7870d0b11e0","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675272163968,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675272163968}},"f5bd06c4-d3f3-427a-9f40-f025255bfe13:e457d131-b871-4005-b5f2-203501516d9d":{"version":1,"data":{"visitorId":"f5bd06c4-d3f3-427a-9f40-f025255bfe13","anonymousId":null,"type":"EVENT","content":{"key":"f5bd06c4-d3f3-427a-9f40-f025255bfe13:e457d131-b871-4005-b5f2-203501516d9d","visitorId":"f5bd06c4-d3f3-427a-9f40-f025255bfe13","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675272904645,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675272904646}},"d6101a5e-10f3-4cfb-aa51-7a31dd1258ec:d0cbb43d-8fe1-4cc1-936b-888dc215ba2d":{"version":1,"data":{"visitorId":"d6101a5e-10f3-4cfb-aa51-7a31dd1258ec","anonymousId":null,"type":"EVENT","content":{"key":"d6101a5e-10f3-4cfb-aa51-7a31dd1258ec:d0cbb43d-8fe1-4cc1-936b-888dc215ba2d","visitorId":"d6101a5e-10f3-4cfb-aa51-7a31dd1258ec","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675273108635,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675273108636}},"3c40e48b-596f-4942-8d78-b851afd65107:ace4f229-f181-4996-8018-af6175fa84e9":{"version":1,"data":{"visitorId":"3c40e48b-596f-4942-8d78-b851afd65107","anonymousId":null,"type":"EVENT","content":{"key":"3c40e48b-596f-4942-8d78-b851afd65107:ace4f229-f181-4996-8018-af6175fa84e9","visitorId":"3c40e48b-596f-4942-8d78-b851afd65107","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675273156875,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675273156876}},"9d473f95-2aad-47c3-8eec-7d2223c30471:4eaa0027-a0cb-4002-b316-0a341775992b":{"version":1,"data":{"visitorId":"9d473f95-2aad-47c3-8eec-7d2223c30471","anonymousId":null,"type":"EVENT","content":{"key":"9d473f95-2aad-47c3-8eec-7d2223c30471:4eaa0027-a0cb-4002-b316-0a341775992b","visitorId":"9d473f95-2aad-47c3-8eec-7d2223c30471","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675273194299,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675273194300}}}
DEBUG [2023-01-03 19:39:57.636] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor identifier is empty. A UUID d4dcaa87-0aa0-4cb3-9526-e5e4f09e2570 has been generated.
DEBUG [2023-01-03 19:39:57.638] [Flagship SDK] [DEBUG] [UPDATE CONTEXT] : visitor `d4dcaa87-0aa0-4cb3-9526-e5e4f09e2570`, context have been updated: key/value {"language":"en","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}, Context {"fs_client":"React-Native","fs_version":"3.1.0","fs_users":"d4dcaa87-0aa0-4cb3-9526-e5e4f09e2570","language":"en","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}
DEBUG [2023-01-03 19:39:57.639] [Flagship SDK] [DEBUG] [NEW VISITOR] : Predefined Context have been loaded {"fs_client":"React-Native","fs_version":"3.1.0","fs_users":"d4dcaa87-0aa0-4cb3-9526-e5e4f09e2570"}
DEBUG [2023-01-03 19:39:57.642] [Flagship SDK] [DEBUG] [SET_CONSENT] : Visitor `d4dcaa87-0aa0-4cb3-9526-e5e4f09e2570` consent has been changed : true
DEBUG [2023-01-03 19:39:57.643] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor undefined has been created with context {"language":"en","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}, isAuthenticated:false and hasConsented true
DEBUG [2023-01-03 19:39:57.645] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor d4dcaa87-0aa0-4cb3-9526-e5e4f09e2570 has been saved in SDK instance
DEBUG [2023-01-03 19:39:57.649] [Flagship SDK] [DEBUG] [FETCH_FLAGS] : visitor `d4dcaa87-0aa0-4cb3-9526-e5e4f09e2570` fetchFlags process is started
LOG before getCampaignsAsync
LOG get campaign async this._httpClient.postAsync function
LOG get campaign async this._httpClient.postAsync typeof fetch function
LOG get campaign async this._httpClient.postAsync typeof this.config.timeout number
LOG TYPEOF FETCH function
LOG TYPEOF this.getResponse function
LOG GLOBAL FETCH FLAGS ERROR [TypeError: undefined is not a function]
LOG GLOBAL FETCH FLAGS stack TypeError: undefined is not a function
at postAsync (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:173580:19)
at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:166269:44)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164228:26)
at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164250:29)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164257:14)
at Promise (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397397:17)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164246:25)
at apply (native)
at getCampaignsAsync (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:166296:42)
at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:170415:69)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164228:26)
at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164250:29)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164257:14)
at Promise (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397397:17)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164246:25)
at apply (native)
at globalFetchFlags (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:170450:41)
at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:170898:39)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164228:26)
at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164250:29)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164257:14)
at Promise (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397397:17)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164246:25)
at apply (native)
at fetchFlags (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:170902:35)
at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:169681:46)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164228:26)
at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164250:29)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397268:31)
at flush (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397923:13)
at tryCallOne (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:53:16)
at anonymous (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:139:27)
at apply (native)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:30471:26)
at _callTimer (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:30371:17)
at _callReactNativeMicrotasksPass (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:30406:17)
at callReactNativeMicrotasks (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:30613:44)
at __callReactNativeMicrotasks (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23859:46)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23638:45)
at __guard (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23842:15)
at flushedQueue (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23637:21)
at invokeCallbackAndReturnFlushedQueue (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23630:33)
LOG GLOBAL FETCH FLAGS stack FETCH_FLAGS
ERROR [2023-01-03 19:39:57.656] [Flagship SDK] [ERROR] [FETCH_FLAGS] : undefined is not a function
LOG created visitor, error is {}
LOG VISITOR READY [TypeError: undefined is not a function]
ERROR [2023-01-03 19:39:57.660] [Flagship SDK] [ERROR] [onReady] : undefined is not a function
Please let me know if there is any special place in the library code where I could add any extra logs to helps us. I've been into this error for 2 days. The project is quite big and we haven't encountered any such issues with other SDK integrations.
Any help or advice to make progress with this issue will be greatly appreciated.
Hello @fdobre
Could you send the logs obtained with the alpha version @flagship.io/react-native-sdk@3.1.1-alpha.1
======FLAGSHIP STATUS CHANGED TO====== 1
LOG === Flagship init start ===
DEBUG [2023-01-04 16:10:45.44] [Flagship SDK] [DEBUG] [INITIALIZATION] : Flagship SDK version 3.1.1-alpha.0 is starting in DECISION-API mode with config {"_trackingMangerConfig":{"_batchIntervals":5,"_poolMaxSize":10,"_batchStrategy":0},"_decisionApiUrl":"https://decision.flagship.io/v2/","_envId":"cdltkb2b2oo0tjktjdbg","_apiKey":"DgMQYQEYcjmDkYFbFnbarvTCgsVkklmBAEornOlE","_logLevel":9,"_timeout":2,"_fetchNow":true,"_enableClientCache":true,"_decisionMode":"DECISION-API","_hitDeduplicationTime":2,"_disableCache":false,"_visitorCacheImplementation":{},"_hitCacheImplementation":{},"_logManager":{}}
INFO [2023-01-04 16:10:45.50] [Flagship SDK] [INFO] [SDK STATUS] : SDK status has changed: READY
INFO [2023-01-04 16:10:45.52] [Flagship SDK] [INFO] [startBatchingLoop] : Batching Loop have been started
LOG
======FLAGSHIP STATUS CHANGED TO====== 4
LOG === Flagship init done ===
INFO [2023-01-04 16:10:45.55] [Flagship SDK] [INFO] [INITIALIZATION] : Flagship SDK (version: 3.1.1-alpha.0) READY
DEBUG [2023-01-04 16:10:45.72] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor identifier is empty. A UUID c0b0f9d7-9f46-4225-aecc-f29d82631d0d has been generated.
DEBUG [2023-01-04 16:10:45.76] [Flagship SDK] [DEBUG] [UPDATE CONTEXT] : visitor `c0b0f9d7-9f46-4225-aecc-f29d82631d0d`, context have been updated: key/value {"userId":"","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":true}, Context {"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","userId":"","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":true}
DEBUG [2023-01-04 16:10:45.78] [Flagship SDK] [DEBUG] [NEW VISITOR] : Predefined Context have been loaded {"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d"}
DEBUG [2023-01-04 16:10:45.85] [Flagship SDK] [DEBUG] [SET_CONSENT] : Visitor `c0b0f9d7-9f46-4225-aecc-f29d82631d0d` consent has been changed : false
DEBUG [2023-01-04 16:10:45.87] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor c0b0f9d7-9f46-4225-aecc-f29d82631d0d has been created with context {"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","userId":"","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":true}, isAuthenticated:false and hasConsented false
DEBUG [2023-01-04 16:10:45.90] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor c0b0f9d7-9f46-4225-aecc-f29d82631d0d has been saved in SDK instance
DEBUG [2023-01-04 16:10:45.93] [Flagship SDK] [DEBUG] [FETCH_FLAGS] : visitor `c0b0f9d7-9f46-4225-aecc-f29d82631d0d` fetchFlags process is started
ERROR [2023-01-04 16:10:45.100] [Flagship SDK] [ERROR] [FETCH_FLAGS] : undefined is not a function
DEBUG [2023-01-04 16:10:45.105] [Flagship SDK] [DEBUG] [FETCH_FLAGS] : Visitor c0b0f9d7-9f46-4225-aecc-f29d82631d0d, anonymousId null with context {"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","userId":"","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":true} has just fetched campaigns from cache [] in 12 ms
ERROR [2023-01-04 16:10:45.108] [Flagship SDK] [ERROR] [onReady] : undefined is not a function
DEBUG [2023-01-04 16:10:45.110] [Flagship SDK] [DEBUG] [FETCH_FLAGS] : Visitor c0b0f9d7-9f46-4225-aecc-f29d82631d0d, anonymousId null with context {"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","userId":"","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":true} has just fetched flags [] from Campaigns
DEBUG [2023-01-04 16:10:45.117] [Flagship SDK] [DEBUG] [CACHE HIT] : Hit data has been saved into database : {"c0b0f9d7-9f46-4225-aecc-f29d82631d0d:74dbeb1f-72b0-429f-825e-9530a5c71d35":{"version":1,"data":{"visitorId":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","anonymousId":null,"type":"EVENT","content":{"key":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d:74dbeb1f-72b0-429f-825e-9530a5c71d35","visitorId":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675347045083,"category":"User Engagement","action":"fs_consent","label":"React-Native:false"},"time":1675347045084}}}
DEBUG [2023-01-04 16:10:45.120] [Flagship SDK] [DEBUG] [ADD HIT] : The HIT has been added to the pool queue : {"vid":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"EVENT","cuid":null,"qt":37,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:false"}
ERROR [2023-01-04 16:10:50.56] [Flagship SDK] [ERROR] [SEND BATCH] : {"message":"undefined is not a function","data":{"url":"https://events.flagship.io","headers":{"Content-Type":"application/json"},"body":{"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":1,"h":[{"vid":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","t":"EVENT","cuid":null,"qt":4973,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:false"}]},"duration":0,"batchTriggeredBy":"Timer"}}
ERROR [2023-01-04 16:10:55.55] [Flagship SDK] [ERROR] [SEND BATCH] : {"message":"undefined is not a function","data":{"url":"https://events.flagship.io","headers":{"Content-Type":"application/json"},"body":{"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":0,"h":[{"vid":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","t":"EVENT","cuid":null,"qt":9971,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:false"}]},"duration":0,"batchTriggeredBy":"Timer"}}
ERROR [2023-01-04 16:11:00.56] [Flagship SDK] [ERROR] [SEND BATCH] : {"message":"undefined is not a function","data":{"url":"https://events.flagship.io","headers":{"Content-Type":"application/json"},"body":{"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":0,"h":[{"vid":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","t":"EVENT","cuid":null,"qt":14972,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:false"}]},"duration":1,"batchTriggeredBy":"Timer"}}
ERROR [2023-01-04 16:11:05.57] [Flagship SDK] [ERROR] [SEND BATCH] : {"message":"undefined is not a function","data":{"url":"https://events.flagship.io","headers":{"Content-Type":"application/json"},"body":{"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":0,"h":[{"vid":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","t":"EVENT","cuid":null,"qt":19973,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:false"}]},"duration":1,"batchTriggeredBy":"Timer"}}
ERROR [2023-01-04 16:11:10.57] [Flagship SDK] [ERROR] [SEND BATCH] : {"message":"undefined is not a function","data":{"url":"https://events.flagship.io","headers":{"Content-Type":"application/json"},"body":{"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":0,"h":[{"vid":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","t":"EVENT","cuid":null,"qt":24973,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:false"}]},"duration":1,"batchTriggeredBy":"Timer"}}
ERROR [2023-01-04 16:11:15.58] [Flagship SDK] [ERROR] [SEND BATCH] : {"message":"undefined is not a function","data":{"url":"https://events.flagship.io","headers":{"Content-Type":"application/json"},"body":{"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":0,"h":[{"vid":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","t":"EVENT","cuid":null,"qt":29974,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:false"}]},"duration":1,"batchTriggeredBy":"Timer"}}
ERROR [2023-01-04 16:11:20.83] [Flagship SDK] [ERROR] [SEND BATCH] : {"message":"undefined is not a function","data":{"url":"https://events.flagship.io","headers":{"Content-Type":"application/json"},"body":{"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":0,"h":[{"vid":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","t":"EVENT","cuid":null,"qt":34979,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:false"}]},"duration":20,"batchTriggeredBy":"Timer"}}
ERROR [2023-01-04 16:11:25.63] [Flagship SDK] [ERROR] [SEND BATCH] : {"message":"undefined is not a function","data":{"url":"https://events.flagship.io","headers":{"Content-Type":"application/json"},"body":{"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":0,"h":[{"vid":"c0b0f9d7-9f46-4225-aecc-f29d82631d0d","t":"EVENT","cuid":null,"qt":39979,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:false"}]},"duration":1,"batchTriggeredBy":"Timer"}}
I will add more logs before and in the initial fetch flags code and come back.
status changed, fetch is function
LOG
======FLAGSHIP STATUS CHANGED TO====== 1
LOG === Flagship init start ===
DEBUG [2023-01-04 17:07:16.120] [Flagship SDK] [DEBUG] [INITIALIZATION] : Flagship SDK version 3.1.1-alpha.0 is starting in DECISION-API mode with config {"_trackingMangerConfig":{"_batchIntervals":5,"_poolMaxSize":10,"_batchStrategy":0},"_decisionApiUrl":"https://decision.flagship.io/v2/","_envId":"cdltkb2b2oo0tjktjdbg","_apiKey":"DgMQYQEYcjmDkYFbFnbarvTCgsVkklmBAEornOlE","_logLevel":9,"_timeout":2,"_fetchNow":true,"_enableClientCache":true,"_decisionMode":"DECISION-API","_hitDeduplicationTime":2,"_disableCache":false,"_visitorCacheImplementation":{},"_hitCacheImplementation":{},"_logManager":{}}
INFO [2023-01-04 17:07:16.124] [Flagship SDK] [INFO] [SDK STATUS] : SDK status has changed: READY
INFO [2023-01-04 17:07:16.126] [Flagship SDK] [INFO] [startBatchingLoop] : Batching Loop have been started
LOG
status changed, fetch is function
LOG
======FLAGSHIP STATUS CHANGED TO====== 4
LOG === Flagship init done ===
INFO [2023-01-04 17:07:16.127] [Flagship SDK] [INFO] [INITIALIZATION] : Flagship SDK (version: 3.1.1-alpha.0) READY
DEBUG [2023-01-04 17:07:16.135] [Flagship SDK] [DEBUG] [LOOKUP HIT] : Hits data has been loaded from database: {"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1:5429224d-68d8-47ea-86dd-4a5777845137":{"version":1,"data":{"visitorId":"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1","anonymousId":null,"type":"EVENT","content":{"key":"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1:5429224d-68d8-47ea-86dd-4a5777845137","visitorId":"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675350328102,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675350328103}}}
DEBUG [2023-01-04 17:07:16.142] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor identifier is empty. A UUID 2029b54b-c929-49db-9a37-8afdf4138794 has been generated.
DEBUG [2023-01-04 17:07:16.144] [Flagship SDK] [DEBUG] [UPDATE CONTEXT] : visitor `2029b54b-c929-49db-9a37-8afdf4138794`, context have been updated: key/value {"sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}, Context {"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"2029b54b-c929-49db-9a37-8afdf4138794","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}
DEBUG [2023-01-04 17:07:16.145] [Flagship SDK] [DEBUG] [NEW VISITOR] : Predefined Context have been loaded {"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"2029b54b-c929-49db-9a37-8afdf4138794"}
DEBUG [2023-01-04 17:07:16.148] [Flagship SDK] [DEBUG] [SET_CONSENT] : Visitor `2029b54b-c929-49db-9a37-8afdf4138794` consent has been changed : true
DEBUG [2023-01-04 17:07:16.149] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor 2029b54b-c929-49db-9a37-8afdf4138794 has been created with context {"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"2029b54b-c929-49db-9a37-8afdf4138794","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}, isAuthenticated:false and hasConsented true
DEBUG [2023-01-04 17:07:16.151] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor 2029b54b-c929-49db-9a37-8afdf4138794 has been saved in SDK instance
LOG createVisitor {"_events": {}, "_eventsCount": 0, "_maxListeners": undefined, "visitorDelegate": {"_anonymousId": null, "_campaigns": [], "_configManager": {"_config": [DecisionApiConfig], "_decisionManager": [ApiManager], "_trackingManager": [TrackingManager]}, "_context": {"fs_client": "React-Native", "fs_users": "2029b54b-c929-49db-9a37-8afdf4138794", "fs_version": "3.1.1-alpha.0", "sdk_firstTimeInit": false, "sdk_osName": "ios", "sdk_osVersionCode": "16.2"}, "_events": {"ready": [Function anonymous]}, "_eventsCount": 1, "_flags": Map {}, "_hasConsented": true, "_isCleaningDeDuplicationCache": false, "_maxListeners": undefined, "_visitorId": "2029b54b-c929-49db-9a37-8afdf4138794", "deDuplicationCache": {}, "visitorCache": undefined}}
LOG createVisitor fetchNow and fetchFlags true true
LOG globalFetchFlags fetch is function
LOG globalFetchFlags first try before getCampaignsAsync, fetch is function
DEBUG [2023-01-04 17:07:16.161] [Flagship SDK] [DEBUG] [FETCH_FLAGS] : visitor `2029b54b-c929-49db-9a37-8afdf4138794` fetchFlags process is started
LOG inside getDecisionApiCampaignsAsync
LOG POSTING TO https://decision.flagship.io/v2/cdltkb2b2oo0tjktjdbg/campaigns?exposeAllKeys=true fetch is function
LOG calling this._httpCLient.postAsync function
LOG inside post async, fetch is function function
LOG info headers: {"Content-Type": "application/json", "x-api-key": "DgMQYQEYcjmDkYFbFnbarvTCgsVkklmBAEornOlE", "x-sdk-client": "React-Native", "x-sdk-version": "3.1.1-alpha.0"} body: {"visitorId":"2029b54b-c929-49db-9a37-8afdf4138794","anonymousId":null,"trigger_hit":false,"context":{"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"2029b54b-c929-49db-9a37-8afdf4138794","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false},"visitor_consent":true} c.signal: {}
LOG globalFetchFlags first try error [TypeError: undefined is not a function] TypeError: undefined is not a function
at postAsync (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:173618:19)
at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:166480:44)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164216:26)
at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164238:29)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164245:14)
at Promise (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397522:17)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164234:25)
at apply (native)
at getDecisionApiCampaignsAsync (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:166502:53)
at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:166361:51)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164216:26)
at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164238:29)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164245:14)
at Promise (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397522:17)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164234:25)
at apply (native)
at getCampaignsAsync (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:166365:42)
at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:170454:69)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164216:26)
at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164238:29)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164245:14)
at Promise (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397522:17)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164234:25)
at apply (native)
at globalFetchFlags (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:170490:41)
at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:170938:39)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164216:26)
at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164238:29)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164245:14)
at Promise (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397522:17)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164234:25)
at apply (native)
at fetchFlags (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:170942:35)
at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:169827:46)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164216:26)
at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164238:29)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397393:31)
at flush (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:398048:13)
at tryCallOne (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:53:16)
at anonymous (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:139:27)
at apply (native)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:30445:26)
at _callTimer (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:30345:17)
at _callReactNativeMicrotasksPass (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:30380:17)
at callReactNativeMicrotasks (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:30587:44)
at __callReactNativeMicrotasks (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23833:46)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23612:45)
at __guard (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23816:15)
at flushedQueue (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23611:21)
at invokeCallbackAndReturnFlushedQueue (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23604:33)
ERROR [2023-01-04 17:07:16.168] [Flagship SDK] [ERROR] [FETCH_FLAGS] : undefined is not a function
LOG globalFetchFlags second try block
LOG on visitor ready [TypeError: undefined is not a function]
ERROR [2023-01-04 17:07:16.173] [Flagship SDK] [ERROR] [onReady] : undefined is not a function
DEBUG [2023-01-04 17:07:16.174] [Flagship SDK] [DEBUG] [FETCH_FLAGS] : Visitor 2029b54b-c929-49db-9a37-8afdf4138794, anonymousId null with context {"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"2029b54b-c929-49db-9a37-8afdf4138794","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false} has just fetched flags [] from Campaigns
LOG globalFetchFlags second try block finished
DEBUG [2023-01-04 17:07:16.178] [Flagship SDK] [DEBUG] [CACHE HIT] : Hit data has been saved into database : {"2029b54b-c929-49db-9a37-8afdf4138794:cbf07f4e-6eab-40c7-ad75-1244a41c54eb":{"version":1,"data":{"visitorId":"2029b54b-c929-49db-9a37-8afdf4138794","anonymousId":null,"type":"EVENT","content":{"key":"2029b54b-c929-49db-9a37-8afdf4138794:cbf07f4e-6eab-40c7-ad75-1244a41c54eb","visitorId":"2029b54b-c929-49db-9a37-8afdf4138794","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675350436146,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675350436147}}}
DEBUG [2023-01-04 17:07:16.179] [Flagship SDK] [DEBUG] [ADD HIT] : The HIT has been added to the pool queue : {"vid":"2029b54b-c929-49db-9a37-8afdf4138794","ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"EVENT","cuid":null,"qt":33,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"}
LOG has onboarded
LOG Starting profile refresh on cold start
LOG The user has given GDPR consent to use facebook tracking. SDK will be initialised.
LOG === IAP SETUP ===
LOG === IAP INIT CONNECTION ===
LOG GOT RESPONSE, inside getResponse 1 200
LOG GOT RESPONSE, inside getResponse 1
LOG GOT RESPONSE, inside getResponse 2
LOG GOT RESPONSE, inside getResponse 3
LOG GOT RESPONSE, inside getResponse 4
LOG inside post async, fetch is function function
LOG info headers: {"Content-Type": "application/json"} body: {"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":0,"h":[{"vid":"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1","t":"EVENT","cuid":null,"qt":113282,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"2029b54b-c929-49db-9a37-8afdf4138794","t":"EVENT","cuid":null,"qt":5238,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"}]} c.signal: {}
ERROR [2023-01-04 17:07:21.386] [Flagship SDK] [ERROR] [SEND BATCH] : {"message":"undefined is not a function","data":{"url":"https://events.flagship.io","headers":{"Content-Type":"application/json"},"body":{"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":0,"h":[{"vid":"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1","t":"EVENT","cuid":null,"qt":113282,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"2029b54b-c929-49db-9a37-8afdf4138794","t":"EVENT","cuid":null,"qt":5238,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"}]},"duration":2,"batchTriggeredBy":"Timer"}}
LOG GOT RESPONSE, inside getResponse 1 200
LOG GOT RESPONSE, inside getResponse 1
LOG GOT RESPONSE, inside getResponse 2
LOG GOT RESPONSE, inside getResponse 3
LOG GOT RESPONSE, inside getResponse 4
LOG inside post async, fetch is function function
LOG info headers: {"Content-Type": "application/json"} body: {"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":1,"h":[{"vid":"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1","t":"EVENT","cuid":null,"qt":118280,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"2029b54b-c929-49db-9a37-8afdf4138794","t":"EVENT","cuid":null,"qt":10236,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"}]} c.signal: {}
ERROR [2023-01-04 17:07:26.383] [Flagship SDK] [ERROR] [SEND BATCH] : {"message":"undefined is not a function","data":{"url":"https://events.flagship.io","headers":{"Content-Type":"application/json"},"body":{"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":1,"h":[{"vid":"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1","t":"EVENT","cuid":null,"qt":118280,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"2029b54b-c929-49db-9a37-8afdf4138794","t":"EVENT","cuid":null,"qt":10236,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"}]},"duration":1,"batchTriggeredBy":"Timer"}}
LOG GOT RESPONSE, inside getResponse 1 200
LOG GOT RESPONSE, inside getResponse 1
LOG GOT RESPONSE, inside getResponse 2
LOG GOT RESPONSE, inside getResponse 3
LOG GOT RESPONSE, inside getResponse 4
@Heihokon please let me know if more logs are needed.
Thanks @fdobre, we're looking at that
Could you also
fetch
function from these nodeDeps.native.js, nodeDeps.js and nodeDeps.browser.js files by adding a prefix in the logs for each file I will do that.
Meanwhile lists of deps:
"resolutions": {
"react-devtools-core": "~4.14.0"
},
"dependencies": {
"@flagship.io/react-native-sdk": "^3.1.1-alpha.1",
"@react-native-async-storage/async-storage": "^1.17.10",
"@react-native-community/checkbox": "^0.5.5",
"@react-native-community/clipboard": "^1.5.1",
"@react-native-community/datetimepicker": "^6.1.2",
"@react-native-community/netinfo": "^8.2.0",
"@react-native-firebase/analytics": "^16.5.2",
"@react-native-firebase/app": "^16.5.2",
"@react-native-firebase/crashlytics": "^16.5.2",
"@react-native-firebase/dynamic-links": "^16.5.2",
"@react-native-firebase/perf": "^16.5.2",
"@react-native-picker/picker": "^2.4.8",
"@react-navigation/bottom-tabs": "^6.2.4",
"@react-navigation/material-top-tabs": "^6.3.0",
"@react-navigation/native": "^6.0.13",
"@react-navigation/routers": "^6.1.3",
"@react-navigation/stack": "5.14.9",
"@testing-library/react-hooks": "^8.0.1",
"@types/escape-string-regexp": "^2.0.1",
"@types/jwt-decode": "^2.2.1",
"@types/qs": "^6.9.5",
"@types/react-native-background-timer": "^2.0.0",
"@types/react-native-share": "^3.3.3",
"@types/react-native-video": "^5.0.3",
"@types/uuid": "^8.3.0",
"@types/yup": "^0.29.9",
"ably-react-native": "^1.1.1",
"axios": "^0.21.0",
"escape-string-regexp": "^4.0.0",
"formik": "^2.2.1",
"html-entities": "^2.3.3",
"i18n-iso-countries": "^7.4.0",
"i18n-js": "^3.8.0",
"jwt-decode": "^3.1.1",
"moment": "^2.29.1",
"pubsub-js": "^1.9.0",
"qs": "^6.9.4",
"query-string": "^7.1.1",
"react": "^18.0.0",
"react-airplay": "^1.2.0",
"react-content-loader": "^5.1.4",
"react-native": "0.69.6",
"react-native-app-auth": "^6.4.3",
"react-native-autoheight-webview": "^1.6.4",
"react-native-background-timer": "^2.4.0",
"react-native-collapsible": "^1.6.0",
"react-native-color-matrix-image-filters": "^5.2.2",
"react-native-config": "^1.4.0",
"react-native-device-info": "8.4.9",
"react-native-email-link": "^1.13.1",
"react-native-fast-image": "^8.6.1",
"react-native-fbsdk-next": "^4.6.0",
"react-native-gesture-handler": "^2.7.0",
"react-native-get-random-values": "^1.7.0",
"react-native-google-cast": "^4.5.0",
"react-native-iap": "^8.6.7",
"react-native-image-pan-zoom": "^2.1.12",
"react-native-in-app-review": "https://github.com/MinaSamir11/react-native-in-app-review#85576fba74cd13b7eec6b784b9ddc8f45f98c6fb",
"react-native-inappbrowser-reborn": "3.5.1",
"react-native-linear-gradient": "^2.5.6",
"react-native-localize": "^2.2.1",
"react-native-location-enabler": "^4.1.0",
"react-native-modal": "^13.0.1",
"react-native-modal-datetime-picker": "^13.1.2",
"react-native-orientation-locker": "^1.2.0",
"react-native-pager-view": "^5.4.25",
"react-native-permissions": "^3.6.1",
"react-native-picker-select": "8.0.4",
"react-native-qrcode-svg": "^6.1.1",
"react-native-reanimated": "2.9.1",
"react-native-safe-area-context": "^4.4.1",
"react-native-screen-brightness": "./packages/react-native-screen-brightness",
"react-native-screens": "3.17.0",
"react-native-section-list-get-item-layout": "^2.2.3",
"react-native-share": "^7.3.7",
"react-native-shimmer": "^0.6.0",
"react-native-shimmer-placeholder": "^2.0.6",
"react-native-snap-carousel": "4.0.0-beta.6",
"react-native-splash-screen": "^3.2.0",
"react-native-svg": "^13.4.0",
"react-native-swipeable-item": "^1.5.2",
"react-native-tab-view": "^3.3.0",
"react-native-video": "6.0.0-alpha.3",
"react-native-wallet": "^1.0.8",
"react-native-wallet-passes": "^1.2.2",
"react-native-webview": "^11.26.0",
"react-native-wonderpush": "^2.2.5",
"react-native-wonderpush-fcm": "1.0.6",
"react-redux": "^8.0.4",
"redux": "^4.1.2",
"redux-devtools-extension": "^2.13.8",
"redux-persist": "^6.0.0",
"redux-persist-filesystem-storage": "^3.0.0",
"reselect": "^4.0.0",
"rn-fetch-blob": "^0.12.0",
"rn-range-slider": "^1.3.3",
"styled-components": "^5.3.6",
"ts-json-schema-generator": "^0.77.0",
"typesafe-actions": "^5.1.0",
"typescript-json-schema": "^0.43.0",
"typescript-to-json-schema": "^0.6.1",
"uuid": "^8.3.1",
"yup": "^0.29.3"
},
"devDependencies": {
"@babel/core": "^7.19.3",
"@babel/register": "^7.18.9",
"@babel/runtime": "^7.19.4",
"@react-native-community/eslint-config": "^3.1.0",
"@storybook/react-native": "^5.3.25",
"@testing-library/react-native": "^11.4.0",
"@types/i18n-js": "^3.8.3",
"@types/jest": "^29.0.0",
"@types/pubsub-js": "^1.8.1",
"@types/react": "~18.0.0",
"@types/react-dom": "17.0.14",
"@types/react-native": "^0.69.6",
"@types/react-redux": "^7.1.5",
"@types/react-test-renderer": "^18.0.0",
"@types/redux-mock-store": "^1.0.2",
"@types/redux-thunk": "^2.1.0",
"@types/styled-components": "^5.1.26",
"@types/styled-components-react-native": "^5.1.3",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"babel-jest": "29.2.2",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^29.2.2",
"jest-junit": "^14.0.1",
"jetifier": "^1.6.5",
"lint-staged": "^13.0.3",
"lorem-ipsum": "^2.0.3",
"metro-react-native-babel-preset": "^0.70.3",
"prettier": "^2.7.1",
"react-native-storybook-loader": "^2.0.5",
"react-native-svg-transformer": "^1.0.0",
"react-test-renderer": "18.0.0",
"redux-mock-store": "^1.5.4",
"sinon": "^9.2.1",
"ts-jest": "^29.0.3",
"ts-mock-imports": "^1.3.8",
"typescript": "^4.8.4"
},
New logs with extra info:
======FLAGSHIP STATUS CHANGED TO====== 1
LOG === Flagship init start ===
DEBUG [2023-01-04 18:03:00.935] [Flagship SDK] [DEBUG] [INITIALIZATION] : Flagship SDK version 3.1.1-alpha.0 is starting in DECISION-API mode with config {"_trackingMangerConfig":{"_batchIntervals":5,"_poolMaxSize":10,"_batchStrategy":0},"_decisionApiUrl":"https://decision.flagship.io/v2/","_envId":"cdltkb2b2oo0tjktjdbg","_apiKey":"DgMQYQEYcjmDkYFbFnbarvTCgsVkklmBAEornOlE","_logLevel":9,"_timeout":2,"_fetchNow":true,"_enableClientCache":true,"_decisionMode":"DECISION-API","_hitDeduplicationTime":2,"_disableCache":false,"_visitorCacheImplementation":{},"_hitCacheImplementation":{},"_logManager":{}}
INFO [2023-01-04 18:03:00.939] [Flagship SDK] [INFO] [SDK STATUS] : SDK status has changed: READY
INFO [2023-01-04 18:03:00.941] [Flagship SDK] [INFO] [startBatchingLoop] : Batching Loop have been started
LOG
======FLAGSHIP STATUS CHANGED TO====== 4
LOG === Flagship init done ===
INFO [2023-01-04 18:03:00.942] [Flagship SDK] [INFO] [INITIALIZATION] : Flagship SDK (version: 3.1.1-alpha.0) READY
DEBUG [2023-01-04 18:03:00.951] [Flagship SDK] [DEBUG] [LOOKUP HIT] : Hits data has been loaded from database: {"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1:5429224d-68d8-47ea-86dd-4a5777845137":{"version":1,"data":{"visitorId":"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1","anonymousId":null,"type":"EVENT","content":{"key":"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1:5429224d-68d8-47ea-86dd-4a5777845137","visitorId":"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675350328102,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675350328103}},"2029b54b-c929-49db-9a37-8afdf4138794:cbf07f4e-6eab-40c7-ad75-1244a41c54eb":{"version":1,"data":{"visitorId":"2029b54b-c929-49db-9a37-8afdf4138794","anonymousId":null,"type":"EVENT","content":{"key":"2029b54b-c929-49db-9a37-8afdf4138794:cbf07f4e-6eab-40c7-ad75-1244a41c54eb","visitorId":"2029b54b-c929-49db-9a37-8afdf4138794","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675350436146,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675350436147}},"74d1920b-f5d2-4e08-b1db-dbbf5c839ffb:310fa6a5-a136-4125-af6a-c19034f0d601":{"version":1,"data":{"visitorId":"74d1920b-f5d2-4e08-b1db-dbbf5c839ffb","anonymousId":null,"type":"EVENT","content":{"key":"74d1920b-f5d2-4e08-b1db-dbbf5c839ffb:310fa6a5-a136-4125-af6a-c19034f0d601","visitorId":"74d1920b-f5d2-4e08-b1db-dbbf5c839ffb","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675350796964,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675350796965}},"edef0ea9-985f-4ec9-a042-4423c3ed4262:8ee0c9e5-d729-40f1-b2f6-1d8fe2707dfd":{"version":1,"data":{"visitorId":"edef0ea9-985f-4ec9-a042-4423c3ed4262","anonymousId":null,"type":"EVENT","content":{"key":"edef0ea9-985f-4ec9-a042-4423c3ed4262:8ee0c9e5-d729-40f1-b2f6-1d8fe2707dfd","visitorId":"edef0ea9-985f-4ec9-a042-4423c3ed4262","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675350955150,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675350955151}},"08911caf-ceca-4714-bf59-193198d0c016:3f7213b3-7275-460a-9977-6d1bf6d7da7b":{"version":1,"data":{"visitorId":"08911caf-ceca-4714-bf59-193198d0c016","anonymousId":null,"type":"EVENT","content":{"key":"08911caf-ceca-4714-bf59-193198d0c016:3f7213b3-7275-460a-9977-6d1bf6d7da7b","visitorId":"08911caf-ceca-4714-bf59-193198d0c016","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675351099450,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675351099451}},"3cc39c55-642d-4bf7-9528-63bcca205ae0:a2b9cd3f-a5f8-4f62-ba30-1268f1d2d60e":{"version":1,"data":{"visitorId":"3cc39c55-642d-4bf7-9528-63bcca205ae0","anonymousId":null,"type":"EVENT","content":{"key":"3cc39c55-642d-4bf7-9528-63bcca205ae0:a2b9cd3f-a5f8-4f62-ba30-1268f1d2d60e","visitorId":"3cc39c55-642d-4bf7-9528-63bcca205ae0","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675351891452,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675351891454}},"a5edefe7-c696-4ddf-825a-b71ae943e6a7:be805a9a-6bbe-43c2-ab4a-917d9deed2a2":{"version":1,"data":{"visitorId":"a5edefe7-c696-4ddf-825a-b71ae943e6a7","anonymousId":null,"type":"EVENT","content":{"key":"a5edefe7-c696-4ddf-825a-b71ae943e6a7:be805a9a-6bbe-43c2-ab4a-917d9deed2a2","visitorId":"a5edefe7-c696-4ddf-825a-b71ae943e6a7","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675351917107,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675351917108}},"229b8d06-beaa-40b7-b30b-14e3d406fc74:16b2ffc0-fe1f-4c93-9a3e-0cd0d27c98e3":{"version":1,"data":{"visitorId":"229b8d06-beaa-40b7-b30b-14e3d406fc74","anonymousId":null,"type":"EVENT","content":{"key":"229b8d06-beaa-40b7-b30b-14e3d406fc74:16b2ffc0-fe1f-4c93-9a3e-0cd0d27c98e3","visitorId":"229b8d06-beaa-40b7-b30b-14e3d406fc74","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675352204667,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675352204668}},"4854b1cd-5def-4817-a26a-320665ff6a32:e7eaaf5c-8c03-4dbb-bbd1-f30527e655ea":{"version":1,"data":{"visitorId":"4854b1cd-5def-4817-a26a-320665ff6a32","anonymousId":null,"type":"EVENT","content":{"key":"4854b1cd-5def-4817-a26a-320665ff6a32:e7eaaf5c-8c03-4dbb-bbd1-f30527e655ea","visitorId":"4854b1cd-5def-4817-a26a-320665ff6a32","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675352320261,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675352320262}},"93773dc8-b7c5-4086-b010-064b75db9be4:274974ae-b6c7-49b9-abd6-3b76b539c5b2":{"version":1,"data":{"visitorId":"93773dc8-b7c5-4086-b010-064b75db9be4","anonymousId":null,"type":"EVENT","content":{"key":"93773dc8-b7c5-4086-b010-064b75db9be4:274974ae-b6c7-49b9-abd6-3b76b539c5b2","visitorId":"93773dc8-b7c5-4086-b010-064b75db9be4","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675352692517,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675352692518}},"cafc78a9-56f3-432b-a64b-cf8714251b5f:0e0a0a0f-bde6-46d4-a8f8-0946a5918167":{"version":1,"data":{"visitorId":"cafc78a9-56f3-432b-a64b-cf8714251b5f","anonymousId":null,"type":"EVENT","content":{"key":"cafc78a9-56f3-432b-a64b-cf8714251b5f:0e0a0a0f-bde6-46d4-a8f8-0946a5918167","visitorId":"cafc78a9-56f3-432b-a64b-cf8714251b5f","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675352825015,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675352825016}},"448e5d11-3d9c-4b7a-b657-e56610453796:421f0bc9-c611-4e4e-9009-e4f4ebd8639e":{"version":1,"data":{"visitorId":"448e5d11-3d9c-4b7a-b657-e56610453796","anonymousId":null,"type":"EVENT","content":{"key":"448e5d11-3d9c-4b7a-b657-e56610453796:421f0bc9-c611-4e4e-9009-e4f4ebd8639e","visitorId":"448e5d11-3d9c-4b7a-b657-e56610453796","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675353225924,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675353225925}},"d9fe7f7e-1952-4f25-a627-5d5c14ba434f:2acc71b0-349a-459a-bef7-4826fa7591a3":{"version":1,"data":{"visitorId":"d9fe7f7e-1952-4f25-a627-5d5c14ba434f","anonymousId":null,"type":"EVENT","content":{"key":"d9fe7f7e-1952-4f25-a627-5d5c14ba434f:2acc71b0-349a-459a-bef7-4826fa7591a3","visitorId":"d9fe7f7e-1952-4f25-a627-5d5c14ba434f","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675353523376,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675353523377}}}
DEBUG [2023-01-04 18:03:00.958] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor identifier is empty. A UUID b3625a6d-07cc-45c0-913d-0b1c7a737aff has been generated.
DEBUG [2023-01-04 18:03:00.960] [Flagship SDK] [DEBUG] [UPDATE CONTEXT] : visitor `b3625a6d-07cc-45c0-913d-0b1c7a737aff`, context have been updated: key/value {"sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}, Context {"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"b3625a6d-07cc-45c0-913d-0b1c7a737aff","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}
DEBUG [2023-01-04 18:03:00.961] [Flagship SDK] [DEBUG] [NEW VISITOR] : Predefined Context have been loaded {"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"b3625a6d-07cc-45c0-913d-0b1c7a737aff"}
DEBUG [2023-01-04 18:03:00.964] [Flagship SDK] [DEBUG] [SET_CONSENT] : Visitor `b3625a6d-07cc-45c0-913d-0b1c7a737aff` consent has been changed : true
DEBUG [2023-01-04 18:03:00.965] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor b3625a6d-07cc-45c0-913d-0b1c7a737aff has been created with context {"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"b3625a6d-07cc-45c0-913d-0b1c7a737aff","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}, isAuthenticated:false and hasConsented true
DEBUG [2023-01-04 18:03:00.966] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor b3625a6d-07cc-45c0-913d-0b1c7a737aff has been saved in SDK instance
LOG globalFetchFlags fetch is function
LOG globalFetchFlags first try before getCampaignsAsync, fetch is function
DEBUG [2023-01-04 18:03:00.970] [Flagship SDK] [DEBUG] [FETCH_FLAGS] : visitor `b3625a6d-07cc-45c0-913d-0b1c7a737aff` fetchFlags process is started
LOG getCampaigns async called returning getDecisionApiCampaignsAsync
LOG inside getDecisionApiCampaignsAsync
LOG POSTING TO https://decision.flagship.io/v2/cdltkb2b2oo0tjktjdbg/campaigns?exposeAllKeys=true fetch is function
LOG calling this._httpCLient.postAsync function
LOG inside post async, imported fetch is---> function global.fetch is----> function
LOG info headers: {"Content-Type": "application/json", "x-api-key": "DgMQYQEYcjmDkYFbFnbarvTCgsVkklmBAEornOlE", "x-sdk-client": "React-Native", "x-sdk-version": "3.1.1-alpha.0"} body: {"visitorId":"b3625a6d-07cc-45c0-913d-0b1c7a737aff","anonymousId":null,"trigger_hit":false,"context":{"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"b3625a6d-07cc-45c0-913d-0b1c7a737aff","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false},"visitor_consent":true} c.signal: {}
LOG FETCH IN NodeDeps.native.js typeof global.fetch that will be returned function
LOG globalFetchFlags first try error [TypeError: undefined is not a function] TypeError: undefined is not a function
at postAsync (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:173612:19)
at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:166477:44)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164211:26)
at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164233:29)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164240:14)
at Promise (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397516:17)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164229:25)
at apply (native)
at getDecisionApiCampaignsAsync (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:166499:53)
at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:166358:51)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164211:26)
at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164233:29)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164240:14)
at Promise (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397516:17)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164229:25)
at apply (native)
at getCampaignsAsync (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:166362:42)
at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:170451:69)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164211:26)
at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164233:29)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164240:14)
at Promise (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397516:17)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164229:25)
at apply (native)
at globalFetchFlags (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:170487:41)
at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:170935:39)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164211:26)
at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164233:29)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164240:14)
at Promise (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397516:17)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164229:25)
at apply (native)
at fetchFlags (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:170939:35)
at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:169824:46)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164211:26)
at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:164233:29)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:397387:31)
at flush (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:398042:13)
at tryCallOne (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:53:16)
at anonymous (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:139:27)
at apply (native)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:30445:26)
at _callTimer (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:30345:17)
at _callReactNativeMicrotasksPass (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:30380:17)
at callReactNativeMicrotasks (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:30587:44)
at __callReactNativeMicrotasks (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23833:46)
at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23612:45)
at __guard (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23816:15)
at flushedQueue (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23611:21)
at invokeCallbackAndReturnFlushedQueue (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stadion.psg.dev:23604:33)
ERROR [2023-01-04 18:03:00.979] [Flagship SDK] [ERROR] [FETCH_FLAGS] : undefined is not a function
LOG globalFetchFlags second try block
ERROR [2023-01-04 18:03:00.983] [Flagship SDK] [ERROR] [onReady] : undefined is not a function
DEBUG [2023-01-04 18:03:00.985] [Flagship SDK] [DEBUG] [FETCH_FLAGS] : Visitor b3625a6d-07cc-45c0-913d-0b1c7a737aff, anonymousId null with context {"fs_client":"React-Native","fs_version":"3.1.1-alpha.0","fs_users":"b3625a6d-07cc-45c0-913d-0b1c7a737aff","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false} has just fetched flags [] from Campaigns
LOG globalFetchFlags second try block finished
DEBUG [2023-01-04 18:03:00.990] [Flagship SDK] [DEBUG] [CACHE HIT] : Hit data has been saved into database : {"b3625a6d-07cc-45c0-913d-0b1c7a737aff:441717c8-0db6-4d8a-a6fd-a6546850267c":{"version":1,"data":{"visitorId":"b3625a6d-07cc-45c0-913d-0b1c7a737aff","anonymousId":null,"type":"EVENT","content":{"key":"b3625a6d-07cc-45c0-913d-0b1c7a737aff:441717c8-0db6-4d8a-a6fd-a6546850267c","visitorId":"b3625a6d-07cc-45c0-913d-0b1c7a737aff","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675353780962,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675353780963}}}
DEBUG [2023-01-04 18:03:00.991] [Flagship SDK] [DEBUG] [ADD HIT] : The HIT has been added to the pool queue : {"vid":"b3625a6d-07cc-45c0-913d-0b1c7a737aff","ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"EVENT","cuid":null,"qt":29,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"}
LOG inside post async, imported fetch is---> function global.fetch is----> function
LOG info headers: {"Content-Type": "application/json"} body: {"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":1,"h":[{"vid":"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1","t":"EVENT","cuid":null,"qt":3452892,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"2029b54b-c929-49db-9a37-8afdf4138794","t":"EVENT","cuid":null,"qt":3344848,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"74d1920b-f5d2-4e08-b1db-dbbf5c839ffb","t":"EVENT","cuid":null,"qt":2984030,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"edef0ea9-985f-4ec9-a042-4423c3ed4262","t":"EVENT","cuid":null,"qt":2825844,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"08911caf-ceca-4714-bf59-193198d0c016","t":"EVENT","cuid":null,"qt":2681544,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"3cc39c55-642d-4bf7-9528-63bcca205ae0","t":"EVENT","cuid":null,"qt":1889542,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"a5edefe7-c696-4ddf-825a-b71ae943e6a7","t":"EVENT","cuid":null,"qt":1863887,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"229b8d06-beaa-40b7-b30b-14e3d406fc74","t":"EVENT","cuid":null,"qt":1576327,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"4854b1cd-5def-4817-a26a-320665ff6a32","t":"EVENT","cuid":null,"qt":1460733,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"93773dc8-b7c5-4086-b010-064b75db9be4","t":"EVENT","cuid":null,"qt":1088477,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"cafc78a9-56f3-432b-a64b-cf8714251b5f","t":"EVENT","cuid":null,"qt":955979,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"448e5d11-3d9c-4b7a-b657-e56610453796","t":"EVENT","cuid":null,"qt":555071,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"d9fe7f7e-1952-4f25-a627-5d5c14ba434f","t":"EVENT","cuid":null,"qt":257619,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"b3625a6d-07cc-45c0-913d-0b1c7a737aff","t":"EVENT","cuid":null,"qt":33,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"}]} c.signal: {}
LOG FETCH IN NodeDeps.native.js typeof global.fetch that will be returned function
ERROR [2023-01-04 18:03:00.996] [Flagship SDK] [ERROR] [SEND BATCH] : {"message":"undefined is not a function","data":{"url":"https://events.flagship.io","headers":{"Content-Type":"application/json"},"body":{"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":1,"h":[{"vid":"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1","t":"EVENT","cuid":null,"qt":3452892,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"2029b54b-c929-49db-9a37-8afdf4138794","t":"EVENT","cuid":null,"qt":3344848,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"74d1920b-f5d2-4e08-b1db-dbbf5c839ffb","t":"EVENT","cuid":null,"qt":2984030,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"edef0ea9-985f-4ec9-a042-4423c3ed4262","t":"EVENT","cuid":null,"qt":2825844,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"08911caf-ceca-4714-bf59-193198d0c016","t":"EVENT","cuid":null,"qt":2681544,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"3cc39c55-642d-4bf7-9528-63bcca205ae0","t":"EVENT","cuid":null,"qt":1889542,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"a5edefe7-c696-4ddf-825a-b71ae943e6a7","t":"EVENT","cuid":null,"qt":1863887,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"229b8d06-beaa-40b7-b30b-14e3d406fc74","t":"EVENT","cuid":null,"qt":1576327,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"4854b1cd-5def-4817-a26a-320665ff6a32","t":"EVENT","cuid":null,"qt":1460733,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"93773dc8-b7c5-4086-b010-064b75db9be4","t":"EVENT","cuid":null,"qt":1088477,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"cafc78a9-56f3-432b-a64b-cf8714251b5f","t":"EVENT","cuid":null,"qt":955979,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"448e5d11-3d9c-4b7a-b657-e56610453796","t":"EVENT","cuid":null,"qt":555071,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"d9fe7f7e-1952-4f25-a627-5d5c14ba434f","t":"EVENT","cuid":null,"qt":257619,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"b3625a6d-07cc-45c0-913d-0b1c7a737aff","t":"EVENT","cuid":null,"qt":33,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"}]},"duration":1,"batchTriggeredBy":"BatchLength"}}
LOG GOT RESPONSE, inside getResponse 200
LOG GOT RESPONSE returning now
LOG GOT RESPONSE, inside getResponse 200
LOG GOT RESPONSE returning now
.....
.....
@Heihokon thanks a lot for looking into the issue.
I attached the extra logs above.
Please let me know if any extra info is needed for debugging.
FYI: Almost all the responses from BE seem to have contentType image and the campaigns data is not received.
LOG GOT RESPONSE returning now, body type and content is image/gif undefined
LOG FULL RESPONSE: {
"type": "default",
"status": 200,
"ok": true,
"headers": {
"map": {
"access-control-allow-credentials": "true",
"access-control-allow-headers": "Content-Type,Origin,Accept,Set-Cookie,X-ABTasty-CrossDomain",
"access-control-allow-methods": "GET,HEAD,POST",
"access-control-allow-origin": "*",
"alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
"cache-control": "must-revalidate, no-cache, private",
"content-length": "43",
"content-type": "image/gif",
"date": "Thu, 02 Feb 2023 17:21:48 GMT",
"server": "-",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"via": "1.1 google",
"x-envoy-decorator-operation": "-",
"x-envoy-upstream-service-time": "7"
}
},
"url": "https://events.flagship.io/",
"bodyUsed": false,
"_bodyInit": {
"_data": {
"size": 43,
"offset": 0,
"blobId": "3A2FE143-E0D2-4004-A437-4DA883066E22",
"type": "image/gif",
"name": "events.flagship.io.gif",
"__collector": {}
}
},
"_bodyBlob": {
"_data": {
"size": 43,
"offset": 0,
"blobId": "3A2FE143-E0D2-4004-A437-4DA883066E22",
"type": "image/gif",
"name": "events.flagship.io.gif",
"__collector": {}
}
}
}
LOG GOT RESPONSE, inside getResponse 200
LOG GOT RESPONSE returning now, body type and content is application/json {"campaigns": [], "visitorId": "test-id-1"}
LOG FULL RESPONSE: {
"type": "default",
"status": 200,
"ok": true,
"headers": {
"map": {
"access-control-allow-headers": "Content-Type,Authorization,X-Api-Key,X-Sdk-Client,X-Sdk-Version,X-Pop",
"access-control-allow-methods": "GET, POST, OPTIONS",
"access-control-allow-origin": "*",
"access-control-max-age": "7200",
"content-encoding": "gzip",
"content-type": "application/json",
"date": "Thu, 02 Feb 2023 17:21:48 GMT",
"server": "nginx",
"vary": "Accept-Encoding",
"x-cache": "miss",
"x-pop": "eu-west-3",
"x-proxy-version": "1.0.55",
"x-ratelimit-limit": "100",
"x-ratelimit-remaining": "98",
"x-ratelimit-reset": "1",
"x-request-quota-remaining": "999717"
}
},
"url": "https://decision.flagship.io/v2/cdltkb2b2oo0tjktjdbg/campaigns?exposeAllKeys=true",
"bodyUsed": true,
"_bodyInit": {
"_data": {
"size": 40,
"offset": 0,
"blobId": "7C216FDD-AE36-4939-82D1-7582B41E2B17",
"type": "application/json",
"name": "campaigns.json",
"__collector": {}
}
},
"_bodyBlob": {
"_data": {
"size": 40,
"offset": 0,
"blobId": "7C216FDD-AE36-4939-82D1-7582B41E2B17",
"type": "application/json",
"name": "campaigns.json",
"__collector": {}
}
}
}
LOG inside post async, imported fetch is---> function global.fetch is----> function
LOG info headers: {"Content-Type": "application/json"} body: {"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":4,"h":[{"vid":"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1","t":"EVENT","cuid":null,"qt":8185422,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"2029b54b-c929-49db-9a37-8afdf4138794","t":"EVENT","cuid":null,"qt":8077378,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"74d1920b-f5d2-4e08-b1db-dbbf5c839ffb","t":"EVENT","cuid":null,"qt":7716560,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"edef0ea9-985f-4ec9-a042-4423c3ed4262","t":"EVENT","cuid":null,"qt":7558374,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"08911caf-ceca-4714-bf59-193198d0c016","t":"EVENT","cuid":null,"qt":7414074,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"3cc39c55-642d-4bf7-9528-63bcca205ae0","t":"EVENT","cuid":null,"qt":6622072,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"a5edefe7-c696-4ddf-825a-b71ae943e6a7","t":"EVENT","cuid":null,"qt":6596417,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"229b8d06-beaa-40b7-b30b-14e3d406fc74","t":"EVENT","cuid":null,"qt":6308857,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"4854b1cd-5def-4817-a26a-320665ff6a32","t":"EVENT","cuid":null,"qt":6193263,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"93773dc8-b7c5-4086-b010-064b75db9be4","t":"EVENT","cuid":null,"qt":5821007,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"cafc78a9-56f3-432b-a64b-cf8714251b5f","t":"EVENT","cuid":null,"qt":5688509,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"448e5d11-3d9c-4b7a-b657-e56610453796","t":"EVENT","cuid":null,"qt":5287600,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"d9fe7f7e-1952-4f25-a627-5d5c14ba434f","t":"EVENT","cuid":null,"qt":4990148,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"b3625a6d-07cc-45c0-913d-0b1c7a737aff","t":"EVENT","cuid":null,"qt":4732562,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"6cf94dfd-f6ec-4782-a7a6-00e8edddcfad","t":"EVENT","cuid":null,"qt":4439188,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"4a29e3e4-515c-45b4-aa0b-72cdcf518af0","t":"EVENT","cuid":null,"qt":3395684,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"c28bdf7e-f9ba-4227-805e-d731f3d966ac","t":"EVENT","cuid":null,"qt":3086145,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"9fd98656-e65c-46be-9401-149dbf4f1aeb","t":"EVENT","cuid":null,"qt":3070804,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"8555b442-281c-4fd6-8aa0-63b1e7b0a3eb","t":"EVENT","cuid":null,"qt":891652,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"test-id-1","t":"EVENT","cuid":null,"qt":514423,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"test-id-1","t":"EVENT","cuid":null,"qt":379545,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"test-id-1","t":"EVENT","cuid":null,"qt":4986,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"}]} c.signal: {}
LOG FETCH IN NodeDeps.native.js typeof global.fetch that will be returned function
ERROR [2023-01-04 19:21:53.527] [Flagship SDK] [ERROR] [SEND BATCH] : {"message":"undefined is not a function","data":{"url":"https://events.flagship.io","headers":{"Content-Type":"application/json"},"body":{"ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"BATCH","qt":4,"h":[{"vid":"14eeb6d8-9252-4b9b-b6dc-f9c44b00cdc1","t":"EVENT","cuid":null,"qt":8185422,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"2029b54b-c929-49db-9a37-8afdf4138794","t":"EVENT","cuid":null,"qt":8077378,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"74d1920b-f5d2-4e08-b1db-dbbf5c839ffb","t":"EVENT","cuid":null,"qt":7716560,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"edef0ea9-985f-4ec9-a042-4423c3ed4262","t":"EVENT","cuid":null,"qt":7558374,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"08911caf-ceca-4714-bf59-193198d0c016","t":"EVENT","cuid":null,"qt":7414074,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"3cc39c55-642d-4bf7-9528-63bcca205ae0","t":"EVENT","cuid":null,"qt":6622072,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"a5edefe7-c696-4ddf-825a-b71ae943e6a7","t":"EVENT","cuid":null,"qt":6596417,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"229b8d06-beaa-40b7-b30b-14e3d406fc74","t":"EVENT","cuid":null,"qt":6308857,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"4854b1cd-5def-4817-a26a-320665ff6a32","t":"EVENT","cuid":null,"qt":6193263,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"93773dc8-b7c5-4086-b010-064b75db9be4","t":"EVENT","cuid":null,"qt":5821007,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"cafc78a9-56f3-432b-a64b-cf8714251b5f","t":"EVENT","cuid":null,"qt":5688509,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"448e5d11-3d9c-4b7a-b657-e56610453796","t":"EVENT","cuid":null,"qt":5287600,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"d9fe7f7e-1952-4f25-a627-5d5c14ba434f","t":"EVENT","cuid":null,"qt":4990148,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"b3625a6d-07cc-45c0-913d-0b1c7a737aff","t":"EVENT","cuid":null,"qt":4732562,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"6cf94dfd-f6ec-4782-a7a6-00e8edddcfad","t":"EVENT","cuid":null,"qt":4439188,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"4a29e3e4-515c-45b4-aa0b-72cdcf518af0","t":"EVENT","cuid":null,"qt":3395684,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"c28bdf7e-f9ba-4227-805e-d731f3d966ac","t":"EVENT","cuid":null,"qt":3086145,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"9fd98656-e65c-46be-9401-149dbf4f1aeb","t":"EVENT","cuid":null,"qt":3070804,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"8555b442-281c-4fd6-8aa0-63b1e7b0a3eb","t":"EVENT","cuid":null,"qt":891652,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"test-id-1","t":"EVENT","cuid":null,"qt":514423,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"test-id-1","t":"EVENT","cuid":null,"qt":379545,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"},{"vid":"test-id-1","t":"EVENT","cuid":null,"qt":4986,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"}]},"duration":2,"batchTriggeredBy":"Timer"}}
LOG GOT RESPONSE, inside getResponse 200
LOG GOT RESPONSE returning now, body type and content is image/gif undefined
LOG FULL RESPONSE: {
"type": "default",
"status": 200,
"ok": true,
"headers": {
"map": {
"access-control-allow-credentials": "true",
"access-control-allow-headers": "Content-Type,Origin,Accept,Set-Cookie,X-ABTasty-CrossDomain",
"access-control-allow-methods": "GET,HEAD,POST",
"access-control-allow-origin": "*",
"alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
"cache-control": "must-revalidate, no-cache, private",
"content-length": "43",
"content-type": "image/gif", //<-------------
"date": "Thu, 02 Feb 2023 17:21:53 GMT",
"server": "-",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"via": "1.1 google",
"x-envoy-decorator-operation": "-",
"x-envoy-upstream-service-time": "2"
}
},
"url": "https://events.flagship.io/",
"bodyUsed": false,
"_bodyInit": {
"_data": {
"size": 43,
"offset": 0,
"blobId": "10108689-595A-463D-84BE-5DFE30F82C50",
"type": "image/gif",
"name": "events.flagship.io.gif",
"__collector": {}
}
},
"_bodyBlob": {
"_data": {
"size": 43,
"offset": 0,
"blobId": "10108689-595A-463D-84BE-5DFE30F82C50",
"type": "image/gif",
"name": "events.flagship.io.gif",
"__collector": {}
}
}
}
@Heihokon please let me know if any additional info is needed here: metro config, babel config, nodeV etc.
Once again thank you for all your support!
Hello @fdobre thank you for your feedback, the alpha version is available yarn add @flagship.io/react-native-sdk@alpha
.
Waiting for your feedback Thanks!
@Heihokon Awesome! Thank you! The alpha2 works great. No errors at flagship sdk init when fetching data!
======FLAGSHIP STATUS CHANGED TO====== 1
LOG === Flagship init start ===
DEBUG [2023-02-07 10:53:53.324] [Flagship SDK] [DEBUG] [INITIALIZATION] : Flagship SDK version 3.1.1-alpha.2 is starting in DECISION-API mode with config {"_trackingMangerConfig":{"_batchIntervals":5,"_poolMaxSize":10,"_batchStrategy":0},"_decisionApiUrl":"https://decision.flagship.io/v2/","_envId":"cdltkb2b2oo0tjktjdbg","_apiKey":"DgMQYQEYcjmDkYFbFnbarvTCgsVkklmBAEornOlE","_logLevel":9,"_timeout":2,"_fetchNow":true,"_enableClientCache":true,"_decisionMode":"DECISION-API","_hitDeduplicationTime":2,"_disableCache":false,"_visitorCacheImplementation":{},"_hitCacheImplementation":{},"_logManager":{}}
INFO [2023-02-07 10:53:53.332] [Flagship SDK] [INFO] [SDK STATUS] : SDK status has changed: READY
INFO [2023-02-07 10:53:53.334] [Flagship SDK] [INFO] [startBatchingLoop] : Batching Loop have been started
======FLAGSHIP STATUS CHANGED TO====== 4
LOG === Flagship init done ===
INFO [2023-02-07 10:53:53.337] [Flagship SDK] [INFO] [INITIALIZATION] : Flagship SDK (version: 3.1.1-alpha.2) READY
DEBUG [2023-02-07 10:53:53.345] [Flagship SDK] [DEBUG] [LOOKUP HIT] : Hits data has been loaded from database: {"a445a692-c634-438e-b5b1-f182279908f3:cc2f1ca1-61a6-4301-939b-b59b77ec8751":{"version":1,"data":{"visitorId":"a445a692-c634-438e-b5b1-f182279908f3","anonymousId":null,"type":"EVENT","content":{"key":"a445a692-c634-438e-b5b1-f182279908f3:cc2f1ca1-61a6-4301-939b-b59b77ec8751","visitorId":"a445a692-c634-438e-b5b1-f182279908f3","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675616874017,"category":"User Engagement","action":"fs_consent","label":"React-Native:false"},"time":1675616874019}}}
DEBUG [2023-02-07 10:53:53.352] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor identifier is empty. A UUID d35202d7-2a5a-4539-9eac-7ca834852d7e has been generated.
DEBUG [2023-02-07 10:53:53.356] [Flagship SDK] [DEBUG] [UPDATE CONTEXT] : visitor `d35202d7-2a5a-4539-9eac-7ca834852d7e`, context have been updated: key/value {"sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}, Context {"fs_client":"React-Native","fs_version":"3.1.1-alpha.2","fs_users":"d35202d7-2a5a-4539-9eac-7ca834852d7e","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}
DEBUG [2023-02-07 10:53:53.357] [Flagship SDK] [DEBUG] [NEW VISITOR] : Predefined Context have been loaded {"fs_client":"React-Native","fs_version":"3.1.1-alpha.2","fs_users":"d35202d7-2a5a-4539-9eac-7ca834852d7e"}
DEBUG [2023-02-07 10:53:53.360] [Flagship SDK] [DEBUG] [SET_CONSENT] : Visitor `d35202d7-2a5a-4539-9eac-7ca834852d7e` consent has been changed : true
DEBUG [2023-02-07 10:53:53.362] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor d35202d7-2a5a-4539-9eac-7ca834852d7e has been created with context {"fs_client":"React-Native","fs_version":"3.1.1-alpha.2","fs_users":"d35202d7-2a5a-4539-9eac-7ca834852d7e","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false}, isAuthenticated:false and hasConsented true
DEBUG [2023-02-07 10:53:53.363] [Flagship SDK] [DEBUG] [NEW VISITOR] : Visitor d35202d7-2a5a-4539-9eac-7ca834852d7e has been saved in SDK instance
DEBUG [2023-02-07 10:53:53.366] [Flagship SDK] [DEBUG] [FETCH_FLAGS] : visitor `d35202d7-2a5a-4539-9eac-7ca834852d7e` fetchFlags process is started
DEBUG [2023-02-07 10:53:53.371] [Flagship SDK] [DEBUG] [FLUSH HIT] : The following hit keys have been flushed from database : ["a445a692-c634-438e-b5b1-f182279908f3:cc2f1ca1-61a6-4301-939b-b59b77ec8751"]
DEBUG [2023-02-07 10:53:53.373] [Flagship SDK] [DEBUG] [CACHE HIT] : Hit data has been saved into database : {"d35202d7-2a5a-4539-9eac-7ca834852d7e:290d1470-76da-4519-b09f-313e9fca9ede":{"version":1,"data":{"visitorId":"d35202d7-2a5a-4539-9eac-7ca834852d7e","anonymousId":null,"type":"EVENT","content":{"key":"d35202d7-2a5a-4539-9eac-7ca834852d7e:290d1470-76da-4519-b09f-313e9fca9ede","visitorId":"d35202d7-2a5a-4539-9eac-7ca834852d7e","ds":"APP","type":"EVENT","anonymousId":null,"createdAt":1675760033359,"category":"User Engagement","action":"fs_consent","label":"React-Native:true"},"time":1675760033360}}}
DEBUG [2023-02-07 10:53:53.375] [Flagship SDK] [DEBUG] [ADD HIT] : The HIT has been added to the pool queue : {"vid":"d35202d7-2a5a-4539-9eac-7ca834852d7e","ds":"APP","cid":"cdltkb2b2oo0tjktjdbg","t":"EVENT","cuid":null,"qt":16,"ec":"User Engagement","ea":"fs_consent","el":"React-Native:true"}
DEBUG [2023-02-07 10:53:53.612] [Flagship SDK] [DEBUG] [FETCH_FLAGS] : Visitor d35202d7-2a5a-4539-9eac-7ca834852d7e, anonymousId null with context {"fs_client":"React-Native","fs_version":"3.1.1-alpha.2","fs_users":"d35202d7-2a5a-4539-9eac-7ca834852d7e","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false} has just fetched campaigns [] in 245 ms
LOG ===FLAGSHIP ON UPDATE=== {"config": {"_apiKey": "DgMQYQEYcjmDkYFbFnbarvTCgsVkklmBAEornOlE", "_decisionApiUrl": "https://decision.flagship.io/v2/", "_decisionMode": "DECISION-API", "_disableCache": false, "_enableClientCache": true, "_envId": "cdltkb2b2oo0tjktjdbg", "_fetchNow": true, "_hitCacheImplementation": {}, "_hitDeduplicationTime": 2, "_initialBucketing": undefined, "_logLevel": 9, "_logManager": {"consoleError": [Function overrideMethod], "consoleWarn": [Function overrideMethod]}, "_onLog": undefined, "_onUserExposure": undefined, "_statusChangedCallback": [Function statusChanged], "_timeout": 2, "_trackingMangerConfig": {"_batchIntervals": 5, "_batchStrategy": 0, "_poolMaxSize": 10}, "_visitorCacheImplementation": {}}, "fsModifications": Map {}, "status": {"firstInitSuccess": "2023-02-07T08:53:53.614Z", "isLoading": false, "isSdkReady": true, "isVisitorDefined": true, "lastRefresh": "2023-02-07T08:53:53.613Z"}}
DEBUG [2023-02-07 10:53:53.620] [Flagship SDK] [DEBUG] [FETCH_FLAGS] : Visitor d35202d7-2a5a-4539-9eac-7ca834852d7e, anonymousId null with context {"fs_client":"React-Native","fs_version":"3.1.1-alpha.2","fs_users":"d35202d7-2a5a-4539-9eac-7ca834852d7e","sdk_osName":"ios","sdk_osVersionCode":"16.2","sdk_firstTimeInit":false} has just fetched flags [] from Campaigns
Please let me know if alpha2 could be used in production in about 1 - 2 weeks from now or if we have to wait for a beta or a stable version.
Steps to replicate: