mirror of
				https://gitcode.com/gh_mirrors/re/react-native-pushy.git
				synced 2025-10-31 21:33:12 +08:00 
			
		
		
		
	fix android
This commit is contained in:
		| @@ -105,7 +105,7 @@ public class UpdateModuleImpl { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private void loadBundleLegacy() { |     private void loadBundleLegacy(ReactApplicationContext mContext) { | ||||||
|         final Activity currentActivity = mContext.getCurrentActivity(); |         final Activity currentActivity = mContext.getCurrentActivity(); | ||||||
|         if (currentActivity == null) { |         if (currentActivity == null) { | ||||||
|             return; |             return; | ||||||
| @@ -156,7 +156,7 @@ public class UpdateModuleImpl { | |||||||
|                 } catch (Throwable err) { |                 } catch (Throwable err) { | ||||||
|                     promise.reject(err); |                     promise.reject(err); | ||||||
|                     Log.e("pushy", "switchVersion failed ", err); |                     Log.e("pushy", "switchVersion failed ", err); | ||||||
|                     loadBundleLegacy(); |                     loadBundleLegacy(mContext); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         }); |         }); | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ import android.util.Log; | |||||||
|  |  | ||||||
| import com.facebook.react.ReactApplication; | import com.facebook.react.ReactApplication; | ||||||
| import com.facebook.react.ReactInstanceManager; | import com.facebook.react.ReactInstanceManager; | ||||||
| import com.facebook.react.bridge.LifecycleEventListener; | // import com.facebook.react.bridge.LifecycleEventListener; | ||||||
| import com.facebook.react.bridge.Promise; | import com.facebook.react.bridge.Promise; | ||||||
| import com.facebook.react.bridge.ReactApplicationContext; | import com.facebook.react.bridge.ReactApplicationContext; | ||||||
| import com.facebook.react.bridge.ReactContext; | import com.facebook.react.bridge.ReactContext; | ||||||
| @@ -32,7 +32,7 @@ import static androidx.core.content.FileProvider.getUriForFile; | |||||||
| public class UpdateModule extends ReactContextBaseJavaModule { | public class UpdateModule extends ReactContextBaseJavaModule { | ||||||
|     UpdateContext updateContext; |     UpdateContext updateContext; | ||||||
|     public static ReactApplicationContext mContext; |     public static ReactApplicationContext mContext; | ||||||
|     private LifecycleEventListener mLifecycleEventListener = null; |     // private LifecycleEventListener mLifecycleEventListener = null; | ||||||
|  |  | ||||||
|     public UpdateModule(ReactApplicationContext reactContext, UpdateContext updateContext) { |     public UpdateModule(ReactApplicationContext reactContext, UpdateContext updateContext) { | ||||||
|         super(reactContext); |         super(reactContext); | ||||||
| @@ -171,7 +171,7 @@ public class UpdateModule extends ReactContextBaseJavaModule { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     private void loadBundleLegacy() { |     private void loadBundleLegacy() { | ||||||
|         final Activity currentActivity = mContext.getCurrentActivity(); |         final Activity currentActivity = getCurrentActivity(); | ||||||
|         if (currentActivity == null) { |         if (currentActivity == null) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|   "name": "react-native-update", |   "name": "react-native-update", | ||||||
|   "version": "10.19.4", |   "version": "10.19.5", | ||||||
|   "description": "react-native hot update", |   "description": "react-native hot update", | ||||||
|   "main": "src/index", |   "main": "src/index", | ||||||
|   "scripts": { |   "scripts": { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 sunny.luo
					sunny.luo