Commit 28a28117 authored by Amit Davidi's avatar Amit Davidi

Upgrade lib and demo projects to RN 0.51

parent bd4d6b7b
@import UIKit; @import UIKit;
#if __has_include(<React/RCTBridgeModule.h>) #import <React/RCTBridgeModule.h>
#import <React/RCTBridgeModule.h>
#else
#import "RCTBridgeModule.h"
#endif
#import <PushKit/PushKit.h> #import <PushKit/PushKit.h>
@interface RNNotifications : NSObject <RCTBridgeModule> @interface RNNotifications : NSObject <RCTBridgeModule>
......
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import <PushKit/PushKit.h> #import <PushKit/PushKit.h>
#if __has_include(<React/RCTBridge.h>) #import <React/RCTBridge.h>
#import <React/RCTBridge.h> #import <React/RCTEventDispatcher.h>
#import <React/RCTEventDispatcher.h> #import "RNNotifications.h"
#import "RNNotifications.h" #import <React/RCTConvert.h>
#import <React/RCTConvert.h> #import <React/RCTUtils.h>
#import <React/RCTUtils.h>
#else
#import "RCTBridge.h"
#import "RCTEventDispatcher.h"
#import "RNNotifications.h"
#import "RCTConvert.h"
#import "RCTUtils.h"
#endif
#import "RNNotificationsBridgeQueue.h" #import "RNNotificationsBridgeQueue.h"
#import <UserNotifications/UserNotifications.h> #import <UserNotifications/UserNotifications.h>
......
...@@ -3,7 +3,6 @@ package com.wix.reactnativenotifications; ...@@ -3,7 +3,6 @@ package com.wix.reactnativenotifications;
import android.app.Application; import android.app.Application;
import com.facebook.react.ReactPackage; import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager; import com.facebook.react.uimanager.ViewManager;
...@@ -14,8 +13,7 @@ import java.util.List; ...@@ -14,8 +13,7 @@ import java.util.List;
public class RNNotificationsPackage implements ReactPackage { public class RNNotificationsPackage implements ReactPackage {
private final Application mApplication;
final Application mApplication;
public RNNotificationsPackage(Application application) { public RNNotificationsPackage(Application application) {
mApplication = application; mApplication = application;
...@@ -26,11 +24,6 @@ public class RNNotificationsPackage implements ReactPackage { ...@@ -26,11 +24,6 @@ public class RNNotificationsPackage implements ReactPackage {
return Arrays.<NativeModule>asList(new RNNotificationsModule(mApplication, reactContext)); return Arrays.<NativeModule>asList(new RNNotificationsModule(mApplication, reactContext));
} }
// Deprecated from RN 0.47
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
@Override @Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList(); return Collections.emptyList();
......
...@@ -8,12 +8,11 @@ import android.os.Bundle; ...@@ -8,12 +8,11 @@ import android.os.Bundle;
import com.wix.reactnativenotifications.core.notification.PushNotificationProps; import com.wix.reactnativenotifications.core.notification.PushNotificationProps;
public class NotificationIntentAdapter { public class NotificationIntentAdapter {
private static final int PENDING_INTENT_CODE = 0;
private static final String PUSH_NOTIFICATION_EXTRA_NAME = "pushNotification"; private static final String PUSH_NOTIFICATION_EXTRA_NAME = "pushNotification";
public static PendingIntent createPendingNotificationIntent(Context appContext, Intent intent, PushNotificationProps notification) { public static PendingIntent createPendingNotificationIntent(Context appContext, Intent intent, PushNotificationProps notification) {
intent.putExtra(PUSH_NOTIFICATION_EXTRA_NAME, notification.asBundle()); intent.putExtra(PUSH_NOTIFICATION_EXTRA_NAME, notification.asBundle());
return PendingIntent.getService(appContext, PENDING_INTENT_CODE, intent, PendingIntent.FLAG_ONE_SHOT); return PendingIntent.getService(appContext, (int) System.currentTimeMillis(), intent, PendingIntent.FLAG_ONE_SHOT);
} }
public static Bundle extractPendingNotificationDataFromIntent(Intent intent) { public static Bundle extractPendingNotificationDataFromIntent(Intent intent) {
......
...@@ -15,7 +15,7 @@ public class MainApplication extends Application implements ReactApplication { ...@@ -15,7 +15,7 @@ public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override @Override
protected boolean getUseDeveloperSupport() { public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG; return BuildConfig.DEBUG;
} }
......
#!/usr/bin/python
from urllib2 import * from urllib2 import *
import json import json
import sys import sys
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
LastUpgradeVersion = "0810" LastUpgradeVersion = "0810"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "NO"
buildImplicitDependencies = "YES"> buildImplicitDependencies = "YES">
<BuildActionEntries> <BuildActionEntries>
<BuildActionEntry <BuildActionEntry
...@@ -14,23 +14,23 @@ ...@@ -14,23 +14,23 @@
buildForAnalyzing = "YES"> buildForAnalyzing = "YES">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
BuildableName = "NotificationsExampleApp.app" BuildableName = "libReact.a"
BlueprintName = "NotificationsExampleApp" BlueprintName = "React"
ReferencedContainer = "container:NotificationsExampleApp.xcodeproj"> ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
<BuildActionEntry <BuildActionEntry
buildForTesting = "YES" buildForTesting = "YES"
buildForRunning = "YES" buildForRunning = "YES"
buildForProfiling = "NO" buildForProfiling = "YES"
buildForArchiving = "NO" buildForArchiving = "YES"
buildForAnalyzing = "YES"> buildForAnalyzing = "YES">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E" BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "NotificationsExampleAppTests.xctest" BuildableName = "NotificationsExampleApp.app"
BlueprintName = "NotificationsExampleAppTests" BlueprintName = "NotificationsExampleApp"
ReferencedContainer = "container:NotificationsExampleApp.xcodeproj"> ReferencedContainer = "container:NotificationsExampleApp.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
...@@ -40,18 +40,9 @@ ...@@ -40,18 +40,9 @@
buildConfiguration = "Debug" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"> shouldUseLaunchSchemeArgsEnv = "YES">
<Testables> <Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "NotificationsExampleAppTests.xctest"
BlueprintName = "NotificationsExampleAppTests"
ReferencedContainer = "container:NotificationsExampleApp.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables> </Testables>
<MacroExpansion> <MacroExpansion>
<BuildableReference <BuildableReference
...@@ -69,6 +60,7 @@ ...@@ -69,6 +60,7 @@
buildConfiguration = "Debug" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0" launchStyle = "0"
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO" ignoresPersistentStateOnLaunch = "NO"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
LastUpgradeVersion = "0810" LastUpgradeVersion = "0810"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "NO"
buildImplicitDependencies = "YES"> buildImplicitDependencies = "YES">
<BuildActionEntries> <BuildActionEntries>
<BuildActionEntry <BuildActionEntry
...@@ -14,23 +14,23 @@ ...@@ -14,23 +14,23 @@
buildForAnalyzing = "YES"> buildForAnalyzing = "YES">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
BuildableName = "NotificationsExampleApp.app" BuildableName = "libReact.a"
BlueprintName = "NotificationsExampleApp" BlueprintName = "React"
ReferencedContainer = "container:NotificationsExampleApp.xcodeproj"> ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
<BuildActionEntry <BuildActionEntry
buildForTesting = "YES" buildForTesting = "YES"
buildForRunning = "YES" buildForRunning = "YES"
buildForProfiling = "NO" buildForProfiling = "YES"
buildForArchiving = "NO" buildForArchiving = "YES"
buildForAnalyzing = "YES"> buildForAnalyzing = "YES">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E" BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "NotificationsExampleAppTests.xctest" BuildableName = "NotificationsExampleApp.app"
BlueprintName = "NotificationsExampleAppTests" BlueprintName = "NotificationsExampleApp"
ReferencedContainer = "container:NotificationsExampleApp.xcodeproj"> ReferencedContainer = "container:NotificationsExampleApp.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
...@@ -40,18 +40,9 @@ ...@@ -40,18 +40,9 @@
buildConfiguration = "Debug" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"> shouldUseLaunchSchemeArgsEnv = "YES">
<Testables> <Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "NotificationsExampleAppTests.xctest"
BlueprintName = "NotificationsExampleAppTests"
ReferencedContainer = "container:NotificationsExampleApp.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables> </Testables>
<MacroExpansion> <MacroExpansion>
<BuildableReference <BuildableReference
...@@ -69,6 +60,7 @@ ...@@ -69,6 +60,7 @@
buildConfiguration = "Debug" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0" launchStyle = "0"
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO" ignoresPersistentStateOnLaunch = "NO"
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
}, },
"dependencies": { "dependencies": {
"babel-preset-react-native-stage-0": "^1.0.1", "babel-preset-react-native-stage-0": "^1.0.1",
"react": "15.4.1", "react": "16.0.0",
"react-native": "0.38.0", "react-native": "0.51.0",
"react-native-notifications": "../" "react-native-notifications": "../"
}, },
"babel": { "babel": {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment