You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.
When running an app in development mode, the library will likely complain about Tracker already initialized errors on app refreshes. This is due to the fact that the iOS native SDK does not support being initialised more than once (PiwikPRO/sdk-demo-ios#1).
The best fix would be for the native SDK to support re-initialisation, but until that happens it would be nice for this library to provide some way of handling the errors in development mode.
The text was updated successfully, but these errors were encountered:
Until we have a better solution at the library level, a simple local workaround for this looks something like this:
piwikPro.init(config.apiUrl,config.siteId).catch(error=>{// Development server refresh will re-initialized the tracker// Catch re-init errors for nicer devleoper experienceif(__DEV__&&error.message==='Tracker already initialized'){return;}console.warn('Failed to initialize Piwik tracker',error);});
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When running an app in development mode, the library will likely complain about
Tracker already initialized
errors on app refreshes. This is due to the fact that the iOS native SDK does not support being initialised more than once (PiwikPRO/sdk-demo-ios#1).The best fix would be for the native SDK to support re-initialisation, but until that happens it would be nice for this library to provide some way of handling the errors in development mode.
The text was updated successfully, but these errors were encountered: