@rollershop/capacitor-emarsys-sdk 1.5.0 → 2.0.0-beta.1

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/Package.swift ADDED
@@ -0,0 +1,30 @@
1
+ // swift-tools-version: 5.9
2
+ import PackageDescription
3
+
4
+ let package = Package(
5
+ name: "RollershopCapacitorEmarsysSdk",
6
+ platforms: [.iOS(.v15)],
7
+ products: [
8
+ .library(
9
+ name: "RollershopCapacitorEmarsysSdk",
10
+ targets: ["EmarsysPlugin"])
11
+ ],
12
+ dependencies: [
13
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0"),
14
+ .package(url: "https://github.com/emartech/ios-emarsys-sdk.git", from: "3.9.0")
15
+ ],
16
+ targets: [
17
+ .target(
18
+ name: "EmarsysPlugin",
19
+ dependencies: [
20
+ .product(name: "Capacitor", package: "capacitor-swift-pm"),
21
+ .product(name: "Cordova", package: "capacitor-swift-pm"),
22
+ .product(name: "EmarsysSDKLibrary", package: "ios-emarsys-sdk"),
23
+ ],
24
+ path: "ios/Sources/EmarsysPlugin"),
25
+ .testTarget(
26
+ name: "EmarsysPluginTests",
27
+ dependencies: ["EmarsysPlugin"],
28
+ path: "ios/Tests/EmarsysPluginTests")
29
+ ]
30
+ )
package/README.md CHANGED
@@ -134,9 +134,11 @@ export default config;
134
134
 
135
135
  ### iOS
136
136
 
137
+ This plugin uses **Swift Package Manager (SPM)**. CocoaPods is no longer supported.
138
+
137
139
  The following changes needs to be done in `AppDelegate.swift`:
138
140
 
139
- 1. Add import: `import RollershopCapacitorEmarsysSdk`
141
+ 1. Add import: `import EmarsysPlugin`
140
142
  2. Extend the base class:
141
143
 
142
144
  ```swift
@@ -154,17 +156,17 @@ Push notification could show media content and action buttons besides the title
154
156
  - [Guide](https://developer.apple.com/documentation/usernotifications/modifying_content_in_newly_delivered_notifications)
155
157
  - Name: `NotificationService`
156
158
  - Language: `swift`
157
- - If Xcode ask's you tu change the scheme, deny it
158
- 2. Navigate to your App's main `Podfile` and add at the bottom of the file:
159
- ```
160
- target "NotificationService" do
161
- pod 'EmarsysNotificationService'
162
- end
163
- ```
164
- 3. You may need to run `pod install` after it
165
- 4. Open the `NotificationService.swift` and replace the content with:
159
+ - If Xcode asks you to change the scheme, deny it
160
+ 2. Add the `ios-emarsys-sdk` package to your project via Xcode:
161
+ - Navigate to your project → **Package Dependencies** → `+`
162
+ - Enter URL: `https://github.com/emartech/ios-emarsys-sdk.git`
163
+ - Select version `3.9.0` (Up to Next Major)
164
+ - Assign `EmarsysNotificationExtensionLibrary` to the `NotificationService` target
165
+ - Assign `EmarsysSDKLibrary` to the `App` target
166
+ 3. Open `NotificationService.swift` and replace the content with:
167
+
166
168
  ```swift
167
- import EmarsysNotificationService
169
+ import EmarsysSDK
168
170
 
169
171
  class NotificationService: EMSNotificationService {
170
172
  }
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
10
10
  s.homepage = package['repository']['url']
11
11
  s.author = package['author']
12
12
  s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
- s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
13
+ s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
14
  s.ios.deployment_target = '17.0'
15
15
  s.dependency 'Capacitor'
16
16
  s.dependency 'EmarsysSDK', '3.9.0'
@@ -3,7 +3,41 @@ import Capacitor
3
3
  import EmarsysSDK
4
4
 
5
5
  @objc(EmarsysPlugin)
6
- public class EmarsysPlugin: CAPPlugin {
6
+ public class EmarsysPlugin: CAPPlugin, CAPBridgedPlugin {
7
+ public let identifier = "EmarsysPlugin"
8
+ public let jsName = "Emarsys"
9
+ public let pluginMethods: [CAPPluginMethod] = [
10
+ CAPPluginMethod(name: "requestPermissions", returnType: CAPPluginReturnPromise),
11
+ CAPPluginMethod(name: "checkPermissions", returnType: CAPPluginReturnPromise),
12
+ CAPPluginMethod(name: "register", returnType: CAPPluginReturnPromise),
13
+ CAPPluginMethod(name: "setContact", returnType: CAPPluginReturnPromise),
14
+ CAPPluginMethod(name: "setAuthenticatedContact", returnType: CAPPluginReturnPromise),
15
+ CAPPluginMethod(name: "clearContact", returnType: CAPPluginReturnPromise),
16
+ CAPPluginMethod(name: "getPushToken", returnType: CAPPluginReturnPromise),
17
+ CAPPluginMethod(name: "clearPushToken", returnType: CAPPluginReturnPromise),
18
+ CAPPluginMethod(name: "pauseInApp", returnType: CAPPluginReturnPromise),
19
+ CAPPluginMethod(name: "isInAppPaused", returnType: CAPPluginReturnPromise),
20
+ CAPPluginMethod(name: "resumeInApp", returnType: CAPPluginReturnPromise),
21
+ CAPPluginMethod(name: "trackItem", returnType: CAPPluginReturnPromise),
22
+ CAPPluginMethod(name: "trackCategory", returnType: CAPPluginReturnPromise),
23
+ CAPPluginMethod(name: "trackSearch", returnType: CAPPluginReturnPromise),
24
+ CAPPluginMethod(name: "trackTag", returnType: CAPPluginReturnPromise),
25
+ CAPPluginMethod(name: "trackCard", returnType: CAPPluginReturnPromise),
26
+ CAPPluginMethod(name: "trackPurchase", returnType: CAPPluginReturnPromise),
27
+ CAPPluginMethod(name: "trackCustomEvent", returnType: CAPPluginReturnPromise),
28
+ CAPPluginMethod(name: "recommendProducts", returnType: CAPPluginReturnPromise),
29
+ CAPPluginMethod(name: "trackRecommendationClick", returnType: CAPPluginReturnPromise),
30
+ CAPPluginMethod(name: "fetchMessages", returnType: CAPPluginReturnPromise),
31
+ CAPPluginMethod(name: "addTag", returnType: CAPPluginReturnPromise),
32
+ CAPPluginMethod(name: "removeTag", returnType: CAPPluginReturnPromise),
33
+ CAPPluginMethod(name: "getApplicationCode", returnType: CAPPluginReturnPromise),
34
+ CAPPluginMethod(name: "setApplicationCode", returnType: CAPPluginReturnPromise),
35
+ CAPPluginMethod(name: "getMerchantId", returnType: CAPPluginReturnPromise),
36
+ CAPPluginMethod(name: "getContactFieldId", returnType: CAPPluginReturnPromise),
37
+ CAPPluginMethod(name: "getHardwareId", returnType: CAPPluginReturnPromise),
38
+ CAPPluginMethod(name: "getLanguageCode", returnType: CAPPluginReturnPromise),
39
+ CAPPluginMethod(name: "getSdkVersion", returnType: CAPPluginReturnPromise),
40
+ ]
7
41
  private var predictHandler = EmarsysPredict();
8
42
  private var inboxHandler = EmarsysInbox();
9
43
  private var configHandler = EmarsysConfig();
@@ -0,0 +1,25 @@
1
+ import XCTest
2
+ @testable import EmarsysPlugin
3
+
4
+ class EmarsysTests: XCTestCase {
5
+ override func setUp() {
6
+ super.setUp()
7
+ // Put setup code here. This method is called before the invocation of each test method in the class.
8
+ }
9
+
10
+ override func tearDown() {
11
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
12
+ super.tearDown()
13
+ }
14
+
15
+ func testEcho() {
16
+ // This is an example of a functional test case for a plugin.
17
+ // Use XCTAssert and related functions to verify your tests produce the correct results.
18
+
19
+ let implementation = Emarsys()
20
+ let value = "Hello, World!"
21
+ let result = implementation.echo(value)
22
+
23
+ XCTAssertEqual(value, result)
24
+ }
25
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rollershop/capacitor-emarsys-sdk",
3
- "version": "1.5.0",
3
+ "version": "2.0.0-beta.1",
4
4
  "description": "Capacitor Plugin that wraps the Emarsys SDK",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -10,7 +10,9 @@
10
10
  "android/src/main/",
11
11
  "android/build.gradle",
12
12
  "dist/",
13
- "ios/Plugin/",
13
+ "ios/Sources",
14
+ "ios/Tests",
15
+ "Package.swift",
14
16
  "RollershopCapacitorEmarsysSdk.podspec"
15
17
  ],
16
18
  "author": "Roller GmbH",
@@ -34,7 +36,7 @@
34
36
  "scripts": {
35
37
  "check:updates": "npm-check --skip-unused -u -E",
36
38
  "verify": "pnpm verify:ios && pnpm verify:web",
37
- "verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin && cd ..",
39
+ "verify:ios": "xcodebuild -scheme RollershopCapacitorEmarsysSdk -destination generic/platform=iOS build",
38
40
  "verify:android": "cd android && ./gradlew clean build test && cd ..",
39
41
  "verify:web": "pnpm build:without:docgen",
40
42
  "lint": "pnpm eslint && pnpm prettier -- --check && pnpm swiftlint -- lint",
@@ -50,20 +52,20 @@
50
52
  "prepublishOnly": "pnpm build"
51
53
  },
52
54
  "devDependencies": {
53
- "@capacitor/android": "^7.0.0",
54
- "@capacitor/cli": "^7.0.0",
55
- "@capacitor/core": "^7.0.0",
56
- "@capacitor/docgen": "^0.3.0",
57
- "@capacitor/ios": "^7.0.0",
58
- "@commitlint/config-conventional": "17.7.0",
55
+ "@capacitor/android": "^8.0.0",
56
+ "@capacitor/cli": "^8.0.0",
57
+ "@capacitor/core": "^8.0.0",
58
+ "@capacitor/docgen": "^0.3.1",
59
+ "@capacitor/ios": "^8.0.0",
60
+ "@commitlint/config-conventional": "20.4.3",
59
61
  "@ionic/eslint-config": "^0.4.0",
60
62
  "@ionic/prettier-config": "4.0.0",
61
63
  "@ionic/swiftlint-config": "^2.0.0",
62
- "@saithodev/semantic-release-backmerge": "3.2.0",
64
+ "@saithodev/semantic-release-backmerge": "4.0.1",
63
65
  "@semantic-release/changelog": "6.0.3",
64
- "@semantic-release/exec": "6.0.3",
66
+ "@semantic-release/exec": "7.1.0",
65
67
  "@semantic-release/git": "10.0.1",
66
- "@semantic-release/npm": "10.0.4",
68
+ "@semantic-release/npm": "13.1.5",
67
69
  "@typescript-eslint/eslint-plugin": "6.4.0",
68
70
  "@typescript-eslint/parser": "6.4.0",
69
71
  "doctoc": "2.2.1",
@@ -73,12 +75,12 @@
73
75
  "prettier-plugin-java": "2.6.7",
74
76
  "rimraf": "6.0.1",
75
77
  "rollup": "4.34.6",
76
- "semantic-release": "21.0.7",
78
+ "semantic-release": "25.0.3",
77
79
  "swiftlint": "^2.0.0",
78
80
  "typescript": "5.7.3"
79
81
  },
80
82
  "peerDependencies": {
81
- "@capacitor/core": ">=7.0.0"
83
+ "@capacitor/core": ">=8.0.0"
82
84
  },
83
85
  "prettier": "@ionic/prettier-config",
84
86
  "swiftlint": "@ionic/swiftlint-config",
@@ -96,7 +98,7 @@
96
98
  "src": "android"
97
99
  }
98
100
  },
99
- "packageManager": "pnpm@8.6.6",
101
+ "packageManager": "pnpm@10.28.2",
100
102
  "publishConfig": {
101
103
  "access": "public"
102
104
  }
@@ -1,10 +0,0 @@
1
- #import <UIKit/UIKit.h>
2
-
3
- //! Project version number for Plugin.
4
- FOUNDATION_EXPORT double PluginVersionNumber;
5
-
6
- //! Project version string for Plugin.
7
- FOUNDATION_EXPORT const unsigned char PluginVersionString[];
8
-
9
- // In this header, you should import all the public headers of your framework using statements like #import <Plugin/PublicHeader.h>
10
-
@@ -1,37 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import <Capacitor/Capacitor.h>
3
-
4
- // Define the plugin using the CAP_PLUGIN Macro, and
5
- // each method the plugin supports using the CAP_PLUGIN_METHOD macro.
6
- CAP_PLUGIN(EmarsysPlugin, "Emarsys",
7
- CAP_PLUGIN_METHOD(requestPermissions, CAPPluginReturnPromise);
8
- CAP_PLUGIN_METHOD(checkPermissions, CAPPluginReturnPromise);
9
- CAP_PLUGIN_METHOD(register, CAPPluginReturnPromise);
10
- CAP_PLUGIN_METHOD(setContact, CAPPluginReturnPromise);
11
- CAP_PLUGIN_METHOD(setAuthenticatedContact, CAPPluginReturnPromise);
12
- CAP_PLUGIN_METHOD(clearContact, CAPPluginReturnPromise);
13
- CAP_PLUGIN_METHOD(getPushToken, CAPPluginReturnPromise);
14
- CAP_PLUGIN_METHOD(clearPushToken, CAPPluginReturnPromise);
15
- CAP_PLUGIN_METHOD(pauseInApp, CAPPluginReturnPromise);
16
- CAP_PLUGIN_METHOD(isInAppPaused, CAPPluginReturnPromise);
17
- CAP_PLUGIN_METHOD(resumeInApp, CAPPluginReturnPromise);
18
- CAP_PLUGIN_METHOD(trackItem, CAPPluginReturnPromise);
19
- CAP_PLUGIN_METHOD(trackCategory, CAPPluginReturnPromise);
20
- CAP_PLUGIN_METHOD(trackSearch, CAPPluginReturnPromise);
21
- CAP_PLUGIN_METHOD(trackTag, CAPPluginReturnPromise);
22
- CAP_PLUGIN_METHOD(trackCard, CAPPluginReturnPromise);
23
- CAP_PLUGIN_METHOD(trackPurchase, CAPPluginReturnPromise);
24
- CAP_PLUGIN_METHOD(trackCustomEvent, CAPPluginReturnPromise);
25
- CAP_PLUGIN_METHOD(recommendProducts, CAPPluginReturnPromise);
26
- CAP_PLUGIN_METHOD(trackRecommendationClick, CAPPluginReturnPromise);
27
- CAP_PLUGIN_METHOD(fetchMessages, CAPPluginReturnPromise);
28
- CAP_PLUGIN_METHOD(addTag, CAPPluginReturnPromise);
29
- CAP_PLUGIN_METHOD(removeTag, CAPPluginReturnPromise);
30
- CAP_PLUGIN_METHOD(getApplicationCode, CAPPluginReturnPromise);
31
- CAP_PLUGIN_METHOD(setApplicationCode, CAPPluginReturnPromise);
32
- CAP_PLUGIN_METHOD(getMerchantId, CAPPluginReturnPromise);
33
- CAP_PLUGIN_METHOD(getContactFieldId, CAPPluginReturnPromise);
34
- CAP_PLUGIN_METHOD(getHardwareId, CAPPluginReturnPromise);
35
- CAP_PLUGIN_METHOD(getLanguageCode, CAPPluginReturnPromise);
36
- CAP_PLUGIN_METHOD(getSdkVersion, CAPPluginReturnPromise);
37
- )
@@ -1,24 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>CFBundleDevelopmentRegion</key>
6
- <string>$(DEVELOPMENT_LANGUAGE)</string>
7
- <key>CFBundleExecutable</key>
8
- <string>$(EXECUTABLE_NAME)</string>
9
- <key>CFBundleIdentifier</key>
10
- <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11
- <key>CFBundleInfoDictionaryVersion</key>
12
- <string>6.0</string>
13
- <key>CFBundleName</key>
14
- <string>$(PRODUCT_NAME)</string>
15
- <key>CFBundlePackageType</key>
16
- <string>FMWK</string>
17
- <key>CFBundleShortVersionString</key>
18
- <string>1.0</string>
19
- <key>CFBundleVersion</key>
20
- <string>$(CURRENT_PROJECT_VERSION)</string>
21
- <key>NSPrincipalClass</key>
22
- <string></string>
23
- </dict>
24
- </plist>