-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch main into cn-voip-removal
- Loading branch information
Showing
108 changed files
with
5,690 additions
and
8,602 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Auto-add issues to org project | ||
|
||
on: | ||
issues: | ||
types: | ||
- opened | ||
|
||
jobs: | ||
add-to-project: | ||
name: Auto-add issues to org project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/add-to-project@v0.5.0 | ||
with: | ||
project-url: https://github.com/orgs/ethereum-push-notification-service/projects/10 | ||
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
88 changes: 0 additions & 88 deletions
88
android/app/src/debug/java/com/epns_mobile_app/ReactNativeFlipper.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 36 additions & 82 deletions
118
android/app/src/main/java/com/epns/MainApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,111 +1,65 @@ | ||
package io.epns.epns; | ||
|
||
import android.app.Application; | ||
import android.content.Context; | ||
import android.content.res.Configuration; | ||
import com.facebook.react.PackageList; | ||
import com.facebook.react.ReactApplication; | ||
import com.facebook.react.ReactInstanceManager; | ||
import com.facebook.react.ReactNativeHost; | ||
import com.facebook.react.ReactPackage; | ||
import com.facebook.react.config.ReactFeatureFlags; | ||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; | ||
import com.facebook.react.defaults.DefaultReactNativeHost; | ||
import com.facebook.soloader.SoLoader; | ||
import expo.modules.ApplicationLifecycleDispatcher; | ||
import expo.modules.ReactNativeHostWrapper; | ||
import io.epns.epns.newarchitecture.MainApplicationReactNativeHost; | ||
import java.lang.reflect.InvocationTargetException; | ||
import java.util.List; | ||
|
||
public class MainApplication extends Application implements ReactApplication { | ||
private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper( | ||
this, | ||
new ReactNativeHost(this) { | ||
|
||
@Override | ||
public boolean getUseDeveloperSupport() { | ||
return BuildConfig.DEBUG; | ||
} | ||
private final ReactNativeHost mReactNativeHost = new DefaultReactNativeHost(this) { | ||
@Override | ||
public boolean getUseDeveloperSupport() { | ||
return BuildConfig.DEBUG; | ||
} | ||
|
||
@Override | ||
protected List<ReactPackage> getPackages() { | ||
@SuppressWarnings("UnnecessaryLocalVariable") | ||
List<ReactPackage> packages = new PackageList(this).getPackages(); | ||
// Packages that cannot be autolinked yet can be added manually here, for example: | ||
// packages.add(new MyReactNativePackage()); | ||
return packages; | ||
} | ||
@Override | ||
protected List<ReactPackage> getPackages() { | ||
@SuppressWarnings("UnnecessaryLocalVariable") | ||
List<ReactPackage> packages = new PackageList(this).getPackages(); | ||
// Packages that cannot be autolinked yet can be added manually here, for | ||
// example: | ||
// packages.add(new MyReactNativePackage()); | ||
return packages; | ||
} | ||
|
||
@Override | ||
protected String getJSMainModuleName() { | ||
return "index"; | ||
} | ||
@Override | ||
protected String getJSMainModuleName() { | ||
return "index"; | ||
} | ||
); | ||
|
||
private final ReactNativeHost mNewArchitectureNativeHost = new ReactNativeHostWrapper( | ||
this, | ||
new MainApplicationReactNativeHost(this) | ||
); | ||
@Override | ||
protected boolean isNewArchEnabled() { | ||
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; | ||
} | ||
|
||
@Override | ||
protected Boolean isHermesEnabled() { | ||
return BuildConfig.IS_HERMES_ENABLED; | ||
} | ||
}; | ||
|
||
@Override | ||
public ReactNativeHost getReactNativeHost() { | ||
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { | ||
return mNewArchitectureNativeHost; | ||
} else { | ||
return mReactNativeHost; | ||
} | ||
return mReactNativeHost; | ||
} | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
// If you opted-in for the New Architecture, we enable the TurboModule system | ||
ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; | ||
SoLoader.init(this, /* native exopackage */false); | ||
initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); | ||
ApplicationLifecycleDispatcher.onApplicationCreate(this); | ||
} | ||
|
||
/** | ||
* Loads Flipper in React Native templates. Call this in the onCreate method with something like | ||
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); | ||
* | ||
* @param context | ||
* @param reactInstanceManager | ||
*/ | ||
private static void initializeFlipper( | ||
Context context, | ||
ReactInstanceManager reactInstanceManager | ||
) { | ||
if (BuildConfig.DEBUG) { | ||
try { | ||
/* | ||
We use reflection here to pick up the class that initializes Flipper, | ||
since Flipper library is not available in release mode | ||
*/ | ||
Class<?> aClass = Class.forName("io.epns.epns.ReactNativeFlipper"); | ||
aClass | ||
.getMethod( | ||
"initializeFlipper", | ||
Context.class, | ||
ReactInstanceManager.class | ||
) | ||
.invoke(null, context, reactInstanceManager); | ||
} catch (ClassNotFoundException e) { | ||
e.printStackTrace(); | ||
} catch (NoSuchMethodException e) { | ||
e.printStackTrace(); | ||
} catch (IllegalAccessException e) { | ||
e.printStackTrace(); | ||
} catch (InvocationTargetException e) { | ||
e.printStackTrace(); | ||
} | ||
SoLoader.init(this, /* native exopackage */ false); | ||
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { | ||
// If you opted-in for the New Architecture, we load the native entry point for | ||
// this app. | ||
DefaultNewArchitectureEntryPoint.load(); | ||
} | ||
} | ||
|
||
@Override | ||
public void onConfigurationChanged(Configuration newConfig) { | ||
super.onConfigurationChanged(newConfig); | ||
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig); | ||
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); | ||
} | ||
} |
Oops, something went wrong.