@allboatsrise/expo-marketingcloudsdk 46.2.0 → 46.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { default } from 'react-native-marketingcloudsdk';
2
- export * from 'react-native-marketingcloudsdk';
1
+ export { default } from '@allboatsrise/react-native-marketingcloudsdk';
2
+ export * from '@allboatsrise/react-native-marketingcloudsdk';
package/build/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { default } from 'react-native-marketingcloudsdk';
2
- export * from 'react-native-marketingcloudsdk';
1
+ export { default } from '@allboatsrise/react-native-marketingcloudsdk';
2
+ export * from '@allboatsrise/react-native-marketingcloudsdk';
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,cAAc,gCAAgC,CAAC","sourcesContent":["export { default } from 'react-native-marketingcloudsdk';\nexport * from 'react-native-marketingcloudsdk';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AACvE,cAAc,8CAA8C,CAAC","sourcesContent":["export { default } from '@allboatsrise/react-native-marketingcloudsdk';\nexport * from '@allboatsrise/react-native-marketingcloudsdk';\n"]}
@@ -32,28 +32,31 @@ EX_REGISTER_SINGLETON_MODULE(MarketingCloud);
32
32
  NSNumber *sfmcInboxEnabled = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"SFMCInboxEnabled"];
33
33
  NSNumber *sfmcLocationEnabled = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"SFMCLocationEnabled"];
34
34
  NSString *sfmcMid = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"SFMCMid"];
35
- NSString *sfmcServerUrl = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"SFMCServerUrl"];
35
+ NSURL *sfmcServerUrl = [NSURL URLWithString:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"SFMCServerUrl"]];
36
36
 
37
- MarketingCloudSDKConfigBuilder *mcsdkBuilder = [MarketingCloudSDKConfigBuilder new];
38
- [mcsdkBuilder sfmc_setAccessToken:sfmcAccessToken];
39
- [mcsdkBuilder sfmc_setAnalyticsEnabled:sfmcAnalyticsEnabled];
40
- [mcsdkBuilder sfmc_setApplicationId:sfmcAppId];
41
- [mcsdkBuilder sfmc_setApplicationControlsBadging:sfmcAppControlsBadging];
42
- [mcsdkBuilder sfmc_setDelayRegistrationUntilContactKeyIsSet:sfmcDelayRegistrationUntilContactKeyIsSet];
43
- [mcsdkBuilder sfmc_setInboxEnabled:sfmcInboxEnabled];
44
- [mcsdkBuilder sfmc_setLocationEnabled:sfmcLocationEnabled];
45
- if ([sfmcMid length] > 0) [mcsdkBuilder sfmc_setMid:sfmcMid];
46
- [mcsdkBuilder sfmc_setMarketingCloudServerUrl:sfmcServerUrl];
47
-
48
- NSError *error = nil;
49
- BOOL success = [[MarketingCloudSDK sharedInstance] sfmc_configureWithDictionary:[mcsdkBuilder sfmc_build] error:&error];
50
-
51
- if (success != YES) {
52
- EXLogError(@"[expo-marketingcloudsdk] Failed to initialize instance. (error: %@)", error);
53
- } else {
54
- [_notificationCenterDelegate addDelegate:self];
37
+ PushConfigBuilder *pushConfigBuilder = [[[[[[[[[PushConfigBuilder alloc] initWithAppId:sfmcAppId]
38
+ setAccessToken:sfmcAccessToken]
39
+ setAnalyticsEnabled:sfmcAnalyticsEnabled]
40
+ setApplicationControlsBadging:sfmcAppControlsBadging]
41
+ setDelayRegistrationUntilContactKeyIsSet:sfmcDelayRegistrationUntilContactKeyIsSet]
42
+ setInboxEnabled:sfmcInboxEnabled]
43
+ setLocationEnabled:sfmcLocationEnabled]
44
+ setMarketingCloudServerUrl:sfmcServerUrl];
45
+
46
+ if ([sfmcMid length] > 0) {
47
+ pushConfigBuilder = [pushConfigBuilder setMid:sfmcMid];
55
48
  }
56
49
 
50
+ [SFMCSdk initializeSdk:[[[SFMCSdkConfigBuilder new] setPushWithConfig:[pushConfigBuilder build] onCompletion:^(SFMCSdkOperationResult result) {
51
+ if (result != SFMCSdkOperationResultSuccess) {
52
+ EXLogError(@"[expo-marketingcloudsdk] Failed to initialize instance. (error: %d)", result);
53
+ } else {
54
+ [self->_notificationCenterDelegate addDelegate:self];
55
+ }
56
+ }] build]];
57
+
58
+
59
+
57
60
  return YES;
58
61
  }
59
62
 
@@ -64,7 +67,7 @@ EX_REGISTER_SINGLETON_MODULE(MarketingCloud);
64
67
  This method will be invoked even if the application was launched or resumed because of the remote notification. The respective delegate methods will be invoked first. Note that this behavior is in contrast to application:didReceiveRemoteNotification:, which is not called in those cases, and which will not be invoked if this method is implemented. **/
65
68
  - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
66
69
  {
67
- [[MarketingCloudSDK sharedInstance] sfmc_setNotificationUserInfo:userInfo];
70
+ [[MobilePushSDK sharedInstance] sfmc_setNotificationUserInfo:userInfo];
68
71
  completionHandler(UIBackgroundFetchResultNewData);
69
72
  }
70
73
 
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
15
15
  s.static_framework = true
16
16
 
17
17
  s.dependency 'ExpoModulesCore'
18
- s.dependency 'RNMarketingCloudSdk', '~>7.5.1'
18
+ s.dependency 'MarketingCloudSDK', '~> 8.0'
19
19
 
20
20
  if !$ExpoUseSources&.include?(package['name']) && ENV['EXPO_USE_SOURCE'].to_i == 0 && File.exist?("#{s.name}.xcframework") && Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.10.0')
21
21
  s.source_files = "#{s.name}/**/*.h"
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@allboatsrise/expo-marketingcloudsdk",
3
3
  "author": "All Boats Rise Inc.",
4
4
  "license": "MIT",
5
- "version": "46.2.0",
5
+ "version": "46.4.0",
6
6
  "description": "Expo module for Salesforce Marketing Cloud SDK",
7
7
  "homepage": "https://github.com/allboatsrise/expo-marketingcloudsdk",
8
8
  "keywords": [
@@ -48,12 +48,12 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "expo-module-scripts": "^2.0.0",
51
- "react-native-marketingcloudsdk": "^7.5.1"
51
+ "@allboatsrise/react-native-marketingcloudsdk": "^7.5.2"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@expo/config-plugins": "^5.0.0",
55
55
  "expo": "*",
56
56
  "expo-notifications": "^0.16.1",
57
- "react-native-marketingcloudsdk": "^7.5.1"
57
+ "@allboatsrise/react-native-marketingcloudsdk": "^7.5.2"
58
58
  }
59
59
  }