iOS 推送成功

This commit is contained in:
mx1700 2019-07-06 17:09:58 +08:00
parent cc73373878
commit 07a2f4493d
7 changed files with 235 additions and 42 deletions

View file

@ -108,7 +108,12 @@ Navigation.events().registerAppLaunchedListener(async () => {
} }
Push.init((msg) => { Push.init((msg) => {
console.log("push init: " + msg) console.log("push init: " + msg);
Push.setAccount("12", (msg) => {
console.log("push setAccount:", JSON.stringify(msg))
})
Push.addReceiveNotificationListener(() => {});
}) })
}); });

View file

@ -5,6 +5,7 @@
}; };
objectVersion = 46; objectVersion = 46;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
@ -46,9 +47,15 @@
444B74B0B45F447FA6D25561 /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A333F2A12D224289B26028D1 /* libRNVectorIcons.a */; }; 444B74B0B45F447FA6D25561 /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A333F2A12D224289B26028D1 /* libRNVectorIcons.a */; };
47AE5EA4A39F43CFA279144B /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B6943EF54DC4C0E8C860C48 /* libRNDeviceInfo.a */; }; 47AE5EA4A39F43CFA279144B /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B6943EF54DC4C0E8C860C48 /* libRNDeviceInfo.a */; };
505DDEF9B17C4B93A7D4C4B0 /* libRCTImageResizer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C988095E6478452AAAF73E23 /* libRCTImageResizer.a */; }; 505DDEF9B17C4B93A7D4C4B0 /* libRCTImageResizer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C988095E6478452AAAF73E23 /* libRCTImageResizer.a */; };
693ABBB722D093C20044FDF8 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 693ABBB622D093C20044FDF8 /* CoreTelephony.framework */; };
693ABBB922D093CE0044FDF8 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 693ABBB822D093CE0044FDF8 /* SystemConfiguration.framework */; };
693ABBBB22D093DE0044FDF8 /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 693ABBBA22D093DD0044FDF8 /* UserNotifications.framework */; };
693ABBBD22D093EC0044FDF8 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 693ABBBC22D093EC0044FDF8 /* libz.tbd */; };
693ABBBF22D093FA0044FDF8 /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 693ABBBE22D093FA0044FDF8 /* libsqlite3.0.tbd */; };
6CA03C7B6F034CF5B2ECC3E5 /* libRNVectorIcons-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FC4807EA1FA42A4A55BDAE5 /* libRNVectorIcons-tvOS.a */; }; 6CA03C7B6F034CF5B2ECC3E5 /* libRNVectorIcons-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FC4807EA1FA42A4A55BDAE5 /* libRNVectorIcons-tvOS.a */; };
6CAEBF678D2F4D3A8D88B88A /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = CC35BDC2C50846E0A4F98D35 /* EvilIcons.ttf */; }; 6CAEBF678D2F4D3A8D88B88A /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = CC35BDC2C50846E0A4F98D35 /* EvilIcons.ttf */; };
71E72460768C4C9EB73C5050 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0D4DF9EF3F764CD0BF997FD6 /* MaterialCommunityIcons.ttf */; }; 71E72460768C4C9EB73C5050 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0D4DF9EF3F764CD0BF997FD6 /* MaterialCommunityIcons.ttf */; };
7497C6D0D64344B197447DC7 /* libRCTXGPushModule.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 62865F98E711415DBA4DAFF9 /* libRCTXGPushModule.a */; };
7CDD27C257FA4106B76D549E /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C558ABC6E5C94D939958E5F9 /* FontAwesome.ttf */; }; 7CDD27C257FA4106B76D549E /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C558ABC6E5C94D939958E5F9 /* FontAwesome.ttf */; };
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
9678DE108DEC4C5A9D92EA1D /* libimageCropPicker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 996469B8096342559A8F98D6 /* libimageCropPicker.a */; }; 9678DE108DEC4C5A9D92EA1D /* libimageCropPicker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 996469B8096342559A8F98D6 /* libimageCropPicker.a */; };
@ -63,7 +70,6 @@
ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; }; ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; };
ED2971652150620600B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2971642150620600B7C4FE /* JavaScriptCore.framework */; }; ED2971652150620600B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2971642150620600B7C4FE /* JavaScriptCore.framework */; };
F343A722A8DB46C79081F2A0 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 81F0243DD71F467A964CAD89 /* Entypo.ttf */; }; F343A722A8DB46C79081F2A0 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 81F0243DD71F467A964CAD89 /* Entypo.ttf */; };
85CC1DC101F845E7A6C77B00 /* libRCTXGPushModule.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E259EF5D4BD4D388D1C513C /* libRCTXGPushModule.a */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@ -382,6 +388,13 @@
remoteGlobalIDString = 2D2A28201D9B03D100D4039D; remoteGlobalIDString = 2D2A28201D9B03D100D4039D;
remoteInfo = "RCTAnimation-tvOS"; remoteInfo = "RCTAnimation-tvOS";
}; };
693ABBB422D0939A0044FDF8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 461950EE4FD949249DD2937B /* RCTXGPushModule.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = B779C03A206113DE0039BF59;
remoteInfo = RCTXGPushModule;
};
78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
@ -452,9 +465,17 @@
4156314A2297CFA5009EB583 /* RSKImageCropper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = RSKImageCropper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4156314A2297CFA5009EB583 /* RSKImageCropper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = RSKImageCropper.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4156314E2297CFBE009EB583 /* QBImagePicker.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = QBImagePicker.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4156314E2297CFBE009EB583 /* QBImagePicker.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = QBImagePicker.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4166A0DE22895B4B0086277D /* ReactNativeNavigation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactNativeNavigation.xcodeproj; path = "../node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.xcodeproj"; sourceTree = "<group>"; }; 4166A0DE22895B4B0086277D /* ReactNativeNavigation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactNativeNavigation.xcodeproj; path = "../node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.xcodeproj"; sourceTree = "<group>"; };
461950EE4FD949249DD2937B /* RCTXGPushModule.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RCTXGPushModule.xcodeproj; path = "../node_modules/react-native-smart-xgpush/ios/RCTXGPushModule.xcodeproj"; sourceTree = "<group>"; };
4B6943EF54DC4C0E8C860C48 /* libRNDeviceInfo.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNDeviceInfo.a; sourceTree = "<group>"; }; 4B6943EF54DC4C0E8C860C48 /* libRNDeviceInfo.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNDeviceInfo.a; sourceTree = "<group>"; };
4DC49BDD3EFD4FA997BEEF58 /* Zocial.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Zocial.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Zocial.ttf"; sourceTree = "<group>"; }; 4DC49BDD3EFD4FA997BEEF58 /* Zocial.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Zocial.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Zocial.ttf"; sourceTree = "<group>"; };
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; }; 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
62865F98E711415DBA4DAFF9 /* libRCTXGPushModule.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTXGPushModule.a; sourceTree = "<group>"; };
693ABB6B22D0925E0044FDF8 /* Timepill.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = Timepill.entitlements; path = Timepill/Timepill.entitlements; sourceTree = "<group>"; };
693ABBB622D093C20044FDF8 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
693ABBB822D093CE0044FDF8 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
693ABBBA22D093DD0044FDF8 /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
693ABBBC22D093EC0044FDF8 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
693ABBBE22D093FA0044FDF8 /* libsqlite3.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.0.tbd; path = usr/lib/libsqlite3.0.tbd; sourceTree = SDKROOT; };
6D8788EB66CB42AAAE311EF6 /* Feather.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Feather.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Feather.ttf"; sourceTree = "<group>"; }; 6D8788EB66CB42AAAE311EF6 /* Feather.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Feather.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Feather.ttf"; sourceTree = "<group>"; };
784C7C58E2B04EECBD71EF5E /* libRNDeviceInfo-tvOS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = "libRNDeviceInfo-tvOS.a"; sourceTree = "<group>"; }; 784C7C58E2B04EECBD71EF5E /* libRNDeviceInfo-tvOS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = "libRNDeviceInfo-tvOS.a"; sourceTree = "<group>"; };
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
@ -477,8 +498,6 @@
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
FE0D7FAFEDE44E168687B4B2 /* RNCAsyncStorage.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNCAsyncStorage.xcodeproj; path = "../node_modules/@react-native-community/async-storage/ios/RNCAsyncStorage.xcodeproj"; sourceTree = "<group>"; }; FE0D7FAFEDE44E168687B4B2 /* RNCAsyncStorage.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNCAsyncStorage.xcodeproj; path = "../node_modules/@react-native-community/async-storage/ios/RNCAsyncStorage.xcodeproj"; sourceTree = "<group>"; };
4C4A99AB1DC742A48D0A1515 /* RCTXGPushModule.xcodeproj */ = {isa = PBXFileReference; name = "RCTXGPushModule.xcodeproj"; path = "../node_modules/react-native-smart-xgpush/ios/RCTXGPushModule.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
3E259EF5D4BD4D388D1C513C /* libRCTXGPushModule.a */ = {isa = PBXFileReference; name = "libRCTXGPushModule.a"; path = "libRCTXGPushModule.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -494,6 +513,11 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
693ABBBF22D093FA0044FDF8 /* libsqlite3.0.tbd in Frameworks */,
693ABBBD22D093EC0044FDF8 /* libz.tbd in Frameworks */,
693ABBBB22D093DE0044FDF8 /* UserNotifications.framework in Frameworks */,
693ABBB922D093CE0044FDF8 /* SystemConfiguration.framework in Frameworks */,
693ABBB722D093C20044FDF8 /* CoreTelephony.framework in Frameworks */,
4166A0E722895B5C0086277D /* libReactNativeNavigation.a in Frameworks */, 4166A0E722895B5C0086277D /* libReactNativeNavigation.a in Frameworks */,
ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */, ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */,
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */, ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */,
@ -516,7 +540,7 @@
9678DE108DEC4C5A9D92EA1D /* libimageCropPicker.a in Frameworks */, 9678DE108DEC4C5A9D92EA1D /* libimageCropPicker.a in Frameworks */,
4156314F2297CFBE009EB583 /* QBImagePicker.framework in Frameworks */, 4156314F2297CFBE009EB583 /* QBImagePicker.framework in Frameworks */,
35DCFF50947D4FCBBF5A8921 /* libRNFetchBlob.a in Frameworks */, 35DCFF50947D4FCBBF5A8921 /* libRNFetchBlob.a in Frameworks */,
85CC1DC101F845E7A6C77B00 /* libRCTXGPushModule.a in Frameworks */, 7497C6D0D64344B197447DC7 /* libRCTXGPushModule.a in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -631,6 +655,7 @@
13B07FAE1A68108700A75B9A /* Timepill */ = { 13B07FAE1A68108700A75B9A /* Timepill */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
693ABB6B22D0925E0044FDF8 /* Timepill.entitlements */,
008F07F21AC5B25A0029DE68 /* main.jsbundle */, 008F07F21AC5B25A0029DE68 /* main.jsbundle */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.m */, 13B07FB01A68108700A75B9A /* AppDelegate.m */,
@ -668,6 +693,11 @@
2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
693ABBBE22D093FA0044FDF8 /* libsqlite3.0.tbd */,
693ABBBC22D093EC0044FDF8 /* libz.tbd */,
693ABBBA22D093DD0044FDF8 /* UserNotifications.framework */,
693ABBB822D093CE0044FDF8 /* SystemConfiguration.framework */,
693ABBB622D093C20044FDF8 /* CoreTelephony.framework */,
ED297162215061F000B7C4FE /* JavaScriptCore.framework */, ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
ED2971642150620600B7C4FE /* JavaScriptCore.framework */, ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
2D16E6891FA4F8E400B85C8A /* libReact.a */, 2D16E6891FA4F8E400B85C8A /* libReact.a */,
@ -719,6 +749,7 @@
C988095E6478452AAAF73E23 /* libRCTImageResizer.a */, C988095E6478452AAAF73E23 /* libRCTImageResizer.a */,
996469B8096342559A8F98D6 /* libimageCropPicker.a */, 996469B8096342559A8F98D6 /* libimageCropPicker.a */,
B2E8AA4B1D85497E86DAA92C /* libRNFetchBlob.a */, B2E8AA4B1D85497E86DAA92C /* libRNFetchBlob.a */,
62865F98E711415DBA4DAFF9 /* libRCTXGPushModule.a */,
); );
name = "Recovered References"; name = "Recovered References";
sourceTree = "<group>"; sourceTree = "<group>";
@ -757,6 +788,14 @@
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
693ABBB122D0939A0044FDF8 /* Products */ = {
isa = PBXGroup;
children = (
693ABBB522D0939A0044FDF8 /* libRCTXGPushModule.a */,
);
name = Products;
sourceTree = "<group>";
};
78C398B11ACF4ADC00677621 /* Products */ = { 78C398B11ACF4ADC00677621 /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -788,7 +827,7 @@
DE970E03BCC84CE8A281A103 /* RCTImageResizer.xcodeproj */, DE970E03BCC84CE8A281A103 /* RCTImageResizer.xcodeproj */,
BDBA91D5680B4ACA83A7844B /* imageCropPicker.xcodeproj */, BDBA91D5680B4ACA83A7844B /* imageCropPicker.xcodeproj */,
99151F1A82BD48E0B5416458 /* RNFetchBlob.xcodeproj */, 99151F1A82BD48E0B5416458 /* RNFetchBlob.xcodeproj */,
4C4A99AB1DC742A48D0A1515 /* RCTXGPushModule.xcodeproj */, 461950EE4FD949249DD2937B /* RCTXGPushModule.xcodeproj */,
); );
name = Libraries; name = Libraries;
sourceTree = "<group>"; sourceTree = "<group>";
@ -945,8 +984,17 @@
TargetAttributes = { TargetAttributes = {
00E356ED1AD99517003FC87E = { 00E356ED1AD99517003FC87E = {
CreatedOnToolsVersion = 6.2; CreatedOnToolsVersion = 6.2;
DevelopmentTeam = 96T8KJDKQ3;
TestTargetID = 13B07F861A680F5B00A75B9A; TestTargetID = 13B07F861A680F5B00A75B9A;
}; };
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = 96T8KJDKQ3;
SystemCapabilities = {
com.apple.Push = {
enabled = 1;
};
};
};
2D02E47A1E0B4A5D006451C7 = { 2D02E47A1E0B4A5D006451C7 = {
CreatedOnToolsVersion = 8.2.1; CreatedOnToolsVersion = 8.2.1;
ProvisioningStyle = Automatic; ProvisioningStyle = Automatic;
@ -1023,6 +1071,10 @@
ProductGroup = 139FDEE71B06529A00C62182 /* Products */; ProductGroup = 139FDEE71B06529A00C62182 /* Products */;
ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
}, },
{
ProductGroup = 693ABBB122D0939A0044FDF8 /* Products */;
ProjectRef = 461950EE4FD949249DD2937B /* RCTXGPushModule.xcodeproj */;
},
{ {
ProductGroup = 146834001AC3E56700842450 /* Products */; ProductGroup = 146834001AC3E56700842450 /* Products */;
ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
@ -1360,6 +1412,13 @@
remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */; remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR; sourceTree = BUILT_PRODUCTS_DIR;
}; };
693ABBB522D0939A0044FDF8 /* libRCTXGPushModule.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRCTXGPushModule.a;
remoteRef = 693ABBB422D0939A0044FDF8 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {
isa = PBXReferenceProxy; isa = PBXReferenceProxy;
fileType = archive.ar; fileType = archive.ar;
@ -1526,6 +1585,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = 96T8KJDKQ3;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1", "DEBUG=1",
"$(inherited)", "$(inherited)",
@ -1570,6 +1630,7 @@
buildSettings = { buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
DEVELOPMENT_TEAM = 96T8KJDKQ3;
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios", "$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios",
@ -1609,8 +1670,10 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Timepill/Timepill.entitlements;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = NO; DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 96T8KJDKQ3;
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../node_modules/react-native-navigation/ios", "$(SRCROOT)/../node_modules/react-native-navigation/ios",
"$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios", "$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios",
@ -1628,7 +1691,7 @@
"-ObjC", "-ObjC",
"-lc++", "-lc++",
); );
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_BUNDLE_IDENTIFIER = "net.timepill.diary-app";
PRODUCT_NAME = Timepill; PRODUCT_NAME = Timepill;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
@ -1638,7 +1701,9 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Timepill/Timepill.entitlements;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 96T8KJDKQ3;
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../node_modules/react-native-navigation/ios", "$(SRCROOT)/../node_modules/react-native-navigation/ios",
"$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios", "$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios",
@ -1656,7 +1721,7 @@
"-ObjC", "-ObjC",
"-lc++", "-lc++",
); );
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_BUNDLE_IDENTIFIER = "net.timepill.diary-app";
PRODUCT_NAME = Timepill; PRODUCT_NAME = Timepill;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };

View file

@ -103,7 +103,7 @@
<EnvironmentVariable <EnvironmentVariable
key = "OS_ACTIVITY_MODE" key = "OS_ACTIVITY_MODE"
value = "disable" value = "disable"
isEnabled = "YES"> isEnabled = "NO">
</EnvironmentVariable> </EnvironmentVariable>
</EnvironmentVariables> </EnvironmentVariables>
<AdditionalOptions> <AdditionalOptions>

View file

@ -11,14 +11,133 @@
#import <React/RCTRootView.h> #import <React/RCTRootView.h>
#import <ReactNativeNavigation/ReactNativeNavigation.h> #import <ReactNativeNavigation/ReactNativeNavigation.h>
#import "XGPush.h"
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
#import <UserNotifications/UserNotifications.h>
#endif
#import "RCTXGPushModule.h"
@interface AppDelegate ()<XGPushDelegate>
@end
@implementation AppDelegate @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{ {
[[XGPush defaultManager] setEnableDebug:YES];
XGNotificationAction *action1 = [XGNotificationAction actionWithIdentifier:@"xgaction001" title:@"xgAction1" options:XGNotificationActionOptionNone];
XGNotificationAction *action2 = [XGNotificationAction actionWithIdentifier:@"xgaction002" title:@"xgAction2" options:XGNotificationActionOptionDestructive];
XGNotificationCategory *category = [XGNotificationCategory categoryWithIdentifier:@"xgCategory" actions:@[action1, action2] intentIdentifiers:@[] options:XGNotificationCategoryOptionNone];
XGNotificationConfigure *configure = [XGNotificationConfigure configureNotificationWithCategories:nil types:XGUserNotificationTypeAlert|XGUserNotificationTypeBadge|XGUserNotificationTypeSound];
[[XGPush defaultManager] setNotificationConfigure:configure];
[[XGPush defaultManager] startXGWithAppID:2200337125 appKey:@"IN15RCD511ZK" delegate:self];
[[XGPush defaultManager] setXgApplicationBadgeNumber:0];
[[XGPush defaultManager] reportXGNotificationInfo:launchOptions];
NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
[ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions]; [ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions];
return YES; return YES;
} }
-(void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error{
NSLog(@"[XGDemo] register APNS fail.\n[XGDemo] reason : %@", error);
[[NSNotificationCenter defaultCenter] postNotificationName:@"registerDeviceFailed" object:nil];
}
/**
@param application UIApplication
@param userInfo
*/
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
NSLog(@"[XGDemo] receive Notification");
[[XGPush defaultManager] reportXGNotificationInfo:userInfo];
NSLog(@"ios 9 ");
if( [UIApplication sharedApplication].applicationState == UIApplicationStateActive)
{
//NSLog(@"didReceiveRemoteNotification:APP在前台运行时不做处理");
[[NSNotificationCenter defaultCenter] postNotificationName:kJPFDidReceiveRemoteNotification object:userInfo];
}//APP
else if([UIApplication sharedApplication].applicationState == UIApplicationStateInactive){
// APNs
//NSLog(@"didReceiveRemoteNotification:APP在后台运行时当有通知栏消息时点击它就会执行下面的方法跳转到相应的页面");
[[NSNotificationCenter defaultCenter] postNotificationName:kJPFOpenNotification object:userInfo];
}
}
/**
@param application UIApplication
@param userInfo
@param completionHandler
*/
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
NSLog(@"[XGDemo] receive slient Notification");
NSLog(@"[XGDemo] userinfo %@", userInfo);
[[XGPush defaultManager] reportXGNotificationInfo:userInfo];
if( [UIApplication sharedApplication].applicationState == UIApplicationStateActive)
{
//NSLog(@"didReceiveRemoteNotification:APP在前台运行时不做处理");
[[NSNotificationCenter defaultCenter] postNotificationName:kJPFDidReceiveRemoteNotification object:userInfo];
}//APP
else if([UIApplication sharedApplication].applicationState == UIApplicationStateInactive){
// APNs
//NSLog(@"didReceiveRemoteNotification:APP在后台运行时当有通知栏消息时点击它就会执行下面的方法跳转到相应的页面");
[[NSNotificationCenter defaultCenter] postNotificationName:kJPFOpenNotification object:userInfo];
}
completionHandler(UIBackgroundFetchResultNewData);
}
// iOS 10 API
// iOS 10 API, iOS 10 API
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
// App
// App
// App
//
- (void)xgPushUserNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler {
NSLog(@"[XGDemo] click notification");
// if ([response.actionIdentifier isEqualToString:@"xgaction001"]) {
// NSLog(@"click from Action1");
// } else if ([response.actionIdentifier isEqualToString:@"xgaction002"]) {
// NSLog(@"click from Action2");
// }
[[XGPush defaultManager] reportXGNotificationResponse:response];
NSDictionary * userInfo = response.notification.request.content.userInfo;
// if([response.notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[[XGPush defaultManager] reportXGNotificationInfo:userInfo];
[[NSNotificationCenter defaultCenter] postNotificationName:kJPFOpenNotification object:userInfo];
completionHandler();
}
// App
- (void)xgPushUserNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {
[[XGPush defaultManager] reportXGNotificationInfo:notification.request.content.userInfo];
NSLog(@"xgPushUserNotificationCenter");
NSDictionary * userInfo = notification.request.content.userInfo;
// if([notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[[XGPush defaultManager] reportXGNotificationInfo:userInfo];
[[NSNotificationCenter defaultCenter] postNotificationName:kJPFDidReceiveRemoteNotification object:userInfo];
completionHandler(UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert);
}
#endif
#pragma mark - XGPushDelegate
- (void)xgPushDidFinishStart:(BOOL)isSuccess error:(NSError *)error {
NSLog(@"%s, result %@, error %@", __FUNCTION__, isSuccess?@"OK":@"NO", error);
}
- (void)xgPushDidFinishStop:(BOOL)isSuccess error:(NSError *)error {
NSLog(@"%s, result %@, error %@", __FUNCTION__, isSuccess?@"OK":@"NO", error);
}
@end @end

View file

@ -2,14 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSCameraUsageDescription</key>
<string/>
<key>NSPhotoLibraryUsageDescription</key>
<string/>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>Timepill</string> <string>胶囊日记</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
@ -28,22 +24,6 @@
<string>1</string> <string>1</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSLocationWhenInUseUsageDescription</key>
<string/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
<dict> <dict>
<key>NSAllowsArbitraryLoads</key> <key>NSAllowsArbitraryLoads</key>
@ -57,6 +37,12 @@
</dict> </dict>
</dict> </dict>
</dict> </dict>
<key>NSCameraUsageDescription</key>
<string></string>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>NSPhotoLibraryUsageDescription</key>
<string></string>
<key>UIAppFonts</key> <key>UIAppFonts</key>
<array> <array>
<string>Entypo.ttf</string> <string>Entypo.ttf</string>
@ -71,5 +57,19 @@
<string>Octicons.ttf</string> <string>Octicons.ttf</string>
<string>Zocial.ttf</string> <string>Zocial.ttf</string>
</array> </array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict> </dict>
</plist> </plist>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>

View file

@ -3,7 +3,7 @@ import XGPushModule from 'react-native-smart-xgpush';
const XGPushNativeModules = NativeModules.XGPushModule; const XGPushNativeModules = NativeModules.XGPushModule;
function init(cb) { function init(cb) {
if(Platform.OS ==='android'){ if(Platform.OS === 'android'){
XGPushNativeModules.enableDebug(true); XGPushNativeModules.enableDebug(true);
XGPushModule.notifyJSDidLoad(() => { XGPushModule.notifyJSDidLoad(() => {
XGPushModule.registerPush(); XGPushModule.registerPush();
@ -13,9 +13,6 @@ function init(cb) {
} else { } else {
cb(); cb();
} }
setAccount("12", (r) => {
console.log('setAccount:', r)
})
} }
function initOtherPush() { function initOtherPush() {
@ -24,14 +21,11 @@ function initOtherPush() {
const appId = '2882303761517764099'; const appId = '2882303761517764099';
const appKey = '5341776464099'; const appKey = '5341776464099';
XGPushNativeModules.initXiaomi(appId, appKey); XGPushNativeModules.initXiaomi(appId, appKey);
addReceiveNotificationListener(null);
} }
function setAccount(uid, cb) { function setAccount(uid, cb) {
if(Platform.OS === 'ios'){ if(Platform.OS === 'ios'){
XGPushModule.setAccount(uid,cb); XGPushModule.setAccount(uid,cb);
}else{ }else{
XGPushModule.bindAccount(uid,cb); XGPushModule.bindAccount(uid,cb);
} }
@ -39,13 +33,14 @@ function setAccount(uid, cb) {
function addReceiveNotificationListener(cb) { function addReceiveNotificationListener(cb) {
XGPushModule.addReceiveNotificationListener((map) => { XGPushModule.addReceiveNotificationListener((map) => {
console.log("[ReceiveNotification]", map) console.log("[ReceiveNotification]", map);
cb(map);
}); });
XGPushModule.addReceiveOpenNotificationListener((msg) => { // XGPushModule.addReceiveOpenNotificationListener((msg) => {
console.log("[addReceiveOpenNotificationListener]", msg) // console.log("[addReceiveOpenNotificationListener]", msg)
//
}) // })
} }
@ -53,4 +48,5 @@ function addReceiveNotificationListener(cb) {
export default { export default {
init, init,
setAccount, setAccount,
addReceiveNotificationListener,
} }