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

Upgrade lib and demo projects to RN 0.51

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