Skip to content

Instantly share code, notes, and snippets.

View naishe's full-sized avatar
🚀
Let's Launch This Thing!

Nishant Neeraj naishe

🚀
Let's Launch This Thing!
View GitHub Profile
@naishe
naishe / App.tsx
Last active December 6, 2020 09:40
Deep Linking Push Notifications with React Navigation #3
// App.tsx
// Deep links
const deepLinksConf = {
screens: {
HomeRoutes: {
initialRouteName: 'Home',
screens: {
Settings: 'settings',
Comics: 'comics/:comicsId',
@naishe
naishe / App.tsx
Last active December 6, 2020 09:37
Deep Linking Push Notifications with React Navigation #1
// App.tsx
const App = () => {
return (
<NavigationContainer>
{/** Your routes here */}
<LoginSignupRoutes />
<HomeRoutes />
</NavigationContainer>
);
}
@naishe
naishe / AndroidManifest.xml
Last active December 6, 2020 09:38
Deep Linking Push Notifications with React Navigation #2
<!-- File Name: android/app/src/main/AndroidManifest.xml -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="your.app.package.name">
<!-- redacted permissions and other tags -->
<application >
<activity >
<!-- redacted other intent filters -->
<!-- this intent filter handles myapp:// scheme -->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
@naishe
naishe / SyncStatus.ts
Created August 5, 2020 06:03
CodePush Integration
enum SyncStatus {
/**
* The app is up-to-date with the CodePush server.
*/
UP_TO_DATE,
/**
* An available update has been installed and will be run either immediately after the
* syncStatusChangedCallback function returns or the next time the app resumes/restarts,
* depending on the InstallMode specified in SyncOptions
@naishe
naishe / VersionInfo.tsx
Created August 4, 2020 06:14
CodePush Integration: UI to switch Versions
import React, {useState} from 'react';
import {StyleSheet, View, Switch, ActivityIndicator} from 'react-native';
import {Text, ThemeProps, ThemeContext} from 'react-native-elements';
import codePush, {LocalPackage} from 'react-native-code-push';
import AsyncStorage from '@react-native-community/async-storage';
import {TouchableOpacity} from 'react-native-gesture-handler';
import {
CODEPUSH_STAGING_DEPLOYMENT_KEY,
CODEPUSH_PRODUCTION_DEPLOYMENT_KEY,
} from '../utils/constants';
@naishe
naishe / costants.ts
Created August 4, 2020 05:56
CodePush Deployment Keys
// CODEPUSH RELATED DATA
export const CODEPUSH_STAGING_DEPLOYMENT_KEY = 'jhai-muzz27Nt7Y11KLp-cBsNA22EGjGHEYfr';
export const CODEPUSH_PRODUCTION_DEPLOYMENT_KEY = 'Jbach1Qk_achQarrrhNOA9zwVlJnruLsa9jsr';
@naishe
naishe / AppWrappedInCodePush.tsx
Created August 4, 2020 05:52
Integrating CodePush Advanced: 1
import React, {Component} from 'react';
import App from './App';
import codePush from 'react-native-code-push';
import AsyncStorage from '@react-native-community/async-storage';
import {
CODEPUSH_STAGING_DEPLOYMENT_KEY,
CODEPUSH_PRODUCTION_DEPLOYMENT_KEY,
} from './utils/constants';
const codePushOptions = {checkFrequency: codePush.CheckFrequency.MANUAL};
@naishe
naishe / Info.plist.diff
Created August 2, 2020 09:45
CodePush 8 (iOS 2)
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>CodePushDeploymentKey</key>
+ <string>Jbach1Qk_achQarrrhNOA9zwVlJnruLsa9jsr</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
@naishe
naishe / AppDelegate.m.diff
Created August 2, 2020 09:42
Integrating CodePush 7 (iOS 1)
// file name: ios/ThatMate/AppDelegate.m
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
+#import <CodePush/CodePush.h> // CodePush
// --- code not shown for brevity ---
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
- #ifdef FB_SONARKIT_ENABLED
@naishe
naishe / codepush_rn_versions.md
Last active August 2, 2020 04:05
Integrating CodePush 7

For future versions refer this repo: https://github.com/microsoft/react-native-code-push

React Native version(s) Supporting CodePush version(s)
<0.14 Unsupported
v0.14 v1.3 (introduced Android support)
v0.15-v0.18 v1.4-v1.6 (introduced iOS asset support)
v0.19-v0.28 v1.7-v1.17 (introduced Android asset support)
v0.29-v0.30 v1.13-v1.17 (RN refactored native hosting code)
v0.31-v0.33 v1.14.6-v1.17 (RN refactored native hosting code)