@media-suite/reactnative-sdk 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,11 +47,20 @@ export function MediaSuiteProvider({ config, children, }) {
47
47
  // Restore or create visitor_id
48
48
  useEffect(() => {
49
49
  (async () => {
50
- let vid = await AsyncStorage.getItem('_ms_vid');
51
- if (!vid) {
50
+ const stored = await AsyncStorage.getItem('_ms_vid');
51
+ let vid;
52
+ if (stored) {
53
+ try {
54
+ vid = JSON.parse(stored);
55
+ }
56
+ catch {
57
+ vid = stored;
58
+ }
59
+ }
60
+ else {
52
61
  vid = uuid();
53
- await AsyncStorage.setItem('_ms_vid', vid);
54
62
  }
63
+ await AsyncStorage.setItem('_ms_vid', JSON.stringify(vid));
55
64
  setVisitorId(vid);
56
65
  })();
57
66
  }, []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@media-suite/reactnative-sdk",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "MediaSuite Native SDK — React Native SDK for rendering and tracking ads in mobile apps. IAB/MRC viewability standards, impression/click tracking, and ad rotation.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",