Skip to content

Instantly share code, notes, and snippets.

@oriharel
oriharel / Batman.js
Created November 6, 2018 14:29
Batman animation in React Native - SVG Path element animation
import React, { Component } from 'react';
import Svg, {Path} from 'react-native-svg';
import {
Animated,
View,
} from 'react-native';
const AnimatedPath = Animated.createAnimatedComponent(Path);
  1. Create a web page that the user will visit (with Safari) before being sent off to Apple App Store
  2. This web page will save a cookie with the value you want in INSTALL_REFERRER
  3. Then redirect to the App Store, user downloads and installs the app
  4. App opens SafariViewController (can be hidden with some tricks) and the web page opened inside has access to the same cookie
  5. The web page in SafariViewController opens a standard URL scheme to communicate back with the app
  6. The app receives the parameter via the URL scheme in AppDelegate

Note that this assumes that the original web page was opened in Safari, if it was opened in some 3rd party app, you're out of luck. There's no 100% accurate method that I know, only heuristic ones in this case.