@purchasely/cordova-plugin-purchasely 6.0.0 → 6.0.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 +77 -0
- package/package.json +11 -2
- package/plugin.xml +4 -4
- package/src/ios/CDVPurchasely.m +22 -4
- package/www/Purchasely.js +1 -1
- package/__tests__/Purchasely.test.js +0 -1826
- package/example/IOS_8_1_1_TEST_MATRIX.md +0 -25
- package/example/android.sh +0 -10
- package/example/config.xml +0 -27
- package/example/e2e/README.md +0 -44
- package/example/e2e/helpers/driver.js +0 -187
- package/example/e2e/package.json +0 -19
- package/example/e2e/specs/bridge.e2e.js +0 -154
- package/example/e2e/specs/dismiss.e2e.js +0 -57
- package/example/e2e/tools/ci_run_e2e.sh +0 -63
- package/example/e2e/tools/ci_run_e2e_ios.sh +0 -56
- package/example/e2e/wdio.android.conf.js +0 -24
- package/example/e2e/wdio.ios.conf.js +0 -44
- package/example/e2e/wdio.shared.conf.js +0 -28
- package/example/ios.sh +0 -17
- package/example/package-lock.json +0 -859
- package/example/package.json +0 -37
- package/example/www/css/index.css +0 -110
- package/example/www/img/logo.png +0 -0
- package/example/www/index.html +0 -78
- package/example/www/js/index.js +0 -453
- package/purchasely.iml +0 -11
package/Package.swift
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// swift-tools-version:5.9
|
|
2
|
+
//
|
|
3
|
+
// Swift Package Manager manifest for the iOS plugin.
|
|
4
|
+
//
|
|
5
|
+
// `plugin.xml` marks the ios platform with package="swift", which makes two hosts read
|
|
6
|
+
// this file instead of building the plugin through CocoaPods:
|
|
7
|
+
//
|
|
8
|
+
// * Cordova iOS 8 and later (Apache's own mechanism)
|
|
9
|
+
// * Capacitor in SPM mode, which is the Capacitor 8 default
|
|
10
|
+
//
|
|
11
|
+
// Capacitor is the reason this exists. Its SPM path never reads <podspec>, so before this
|
|
12
|
+
// manifest a Capacitor 8 app scaffolded with the default package manager linked the plugin
|
|
13
|
+
// with no Purchasely SDK behind it at all, silently.
|
|
14
|
+
//
|
|
15
|
+
// The <podspec> block stays in plugin.xml for CocoaPods consumers: Cordova iOS 7 and
|
|
16
|
+
// earlier, and Capacitor in CocoaPods mode. Its pod carries nospm="true" so Cordova iOS 8
|
|
17
|
+
// does not install the pod AND this package and link Purchasely twice.
|
|
18
|
+
//
|
|
19
|
+
// KEEP THE FIRST DEPENDENCY EXACTLY AS WRITTEN, AND ADD NO PROSE ABOVE IT.
|
|
20
|
+
// The Capacitor CLI rewrites this file in place on every sync
|
|
21
|
+
// (@capacitor/cli, dist/ios/update.js:83-89). It rewrites the first occurrence of the
|
|
22
|
+
// Apache org slug, every occurrence of the upstream repository slug, and then pins the
|
|
23
|
+
// version by replacing everything between the rewritten URL and the next ")". Both slugs
|
|
24
|
+
// are lowercase and hyphenated, and both first appear in the Cordova dependency below.
|
|
25
|
+
// Writing either one in a comment above that line silently retargets the URL to a
|
|
26
|
+
// repository that does not exist, and the plugin then builds with no SDK. The rewrite is
|
|
27
|
+
// idempotent, and this comment is deliberately written without those two literals.
|
|
28
|
+
//
|
|
29
|
+
// Note for local development: npm installs a `file:` dependency as a symlink, so a
|
|
30
|
+
// `npx cap sync` in a sample app that consumes this plugin by path rewrites THIS file in
|
|
31
|
+
// the repository, not a copy. Check `git status` after syncing a local sample.
|
|
32
|
+
//
|
|
33
|
+
// The package and product names must equal the npm package id: the Capacitor CLI hardcodes
|
|
34
|
+
// `plugin.id` on both sides of the generated dependency (dist/util/spm.js:110-112, :164).
|
|
35
|
+
|
|
36
|
+
import PackageDescription
|
|
37
|
+
|
|
38
|
+
let package = Package(
|
|
39
|
+
name: "@purchasely/cordova-plugin-purchasely",
|
|
40
|
+
// 13.0, not higher: Cordova iOS 8 builds its aggregate CordovaPlugins target at 13.0,
|
|
41
|
+
// and a package declaring more fails the build outright ("requires minimum platform
|
|
42
|
+
// version 15.0 ... but this target supports 13.0"). The Purchasely xcframework itself
|
|
43
|
+
// is built for iOS 13.4, so that floor still applies at link time, exactly as it does
|
|
44
|
+
// through the podspec.
|
|
45
|
+
platforms: [.iOS(.v13)],
|
|
46
|
+
products: [
|
|
47
|
+
.library(
|
|
48
|
+
name: "@purchasely/cordova-plugin-purchasely",
|
|
49
|
+
targets: ["PurchaselyCordovaPlugin"]
|
|
50
|
+
)
|
|
51
|
+
],
|
|
52
|
+
dependencies: [
|
|
53
|
+
.package(url: "https://github.com/apache/cordova-ios.git", from: "8.0.0"),
|
|
54
|
+
// exact, not `from:`. A range permits any 6.x, so a fresh resolve picks up
|
|
55
|
+
// whatever is newest while the podspec pins one version and VERSIONS.md
|
|
56
|
+
// documents another. That makes the linked SDK depend on install time and lets
|
|
57
|
+
// the two integration paths drift apart. Bump this with the podspec, in the
|
|
58
|
+
// same commit, and VERSIONS.md with it.
|
|
59
|
+
.package(url: "https://github.com/Purchasely/Purchasely-iOS.git", exact: "6.0.1")
|
|
60
|
+
],
|
|
61
|
+
targets: [
|
|
62
|
+
.target(
|
|
63
|
+
name: "PurchaselyCordovaPlugin",
|
|
64
|
+
dependencies: [
|
|
65
|
+
.product(name: "Cordova", package: "cordova-ios"),
|
|
66
|
+
.product(name: "Purchasely", package: "Purchasely-iOS")
|
|
67
|
+
],
|
|
68
|
+
path: "src/ios",
|
|
69
|
+
publicHeadersPath: ".",
|
|
70
|
+
cSettings: [
|
|
71
|
+
// The Hybrid/ type-marshalling headers are imported unqualified from the
|
|
72
|
+
// sources next to them, so their directory has to be on the search path.
|
|
73
|
+
.headerSearchPath("Hybrid")
|
|
74
|
+
]
|
|
75
|
+
)
|
|
76
|
+
]
|
|
77
|
+
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purchasely/cordova-plugin-purchasely",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "Purchasely is a solution to ease the integration and boost your In-App Purchases & Subscriptions on the App Store, Google Play Store, Amazon Appstore and Huawei App Gallery.",
|
|
5
5
|
"cordova": {
|
|
6
6
|
"id": "@purchasely/cordova-plugin-purchasely",
|
|
@@ -41,6 +41,12 @@
|
|
|
41
41
|
"author": "Purchasely",
|
|
42
42
|
"license": "ISC",
|
|
43
43
|
"main": "index.js",
|
|
44
|
+
"files": [
|
|
45
|
+
"src",
|
|
46
|
+
"www",
|
|
47
|
+
"plugin.xml",
|
|
48
|
+
"Package.swift"
|
|
49
|
+
],
|
|
44
50
|
"directories": {
|
|
45
51
|
"example": "example"
|
|
46
52
|
},
|
|
@@ -57,5 +63,8 @@
|
|
|
57
63
|
"bugs": {
|
|
58
64
|
"url": "https://github.com/Purchasely/Purchasely-Cordova/issues"
|
|
59
65
|
},
|
|
60
|
-
"homepage": "https://github.com/Purchasely/Purchasely-Cordova#readme"
|
|
66
|
+
"homepage": "https://github.com/Purchasely/Purchasely-Cordova#readme",
|
|
67
|
+
"overrides": {
|
|
68
|
+
"js-yaml@3": "^3.15.1"
|
|
69
|
+
}
|
|
61
70
|
}
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="@purchasely/cordova-plugin-purchasely" version="6.0.
|
|
2
|
+
<plugin id="@purchasely/cordova-plugin-purchasely" version="6.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
3
|
<name>Purchasely</name>
|
|
4
4
|
<js-module name="Purchasely" src="www/Purchasely.js">
|
|
5
5
|
<clobbers target="Purchasely" />
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<engine name="cordova" version=">=11.0.0"/>
|
|
9
9
|
<engine name="cordova-android" version=">=12.0.0"/>
|
|
10
10
|
</engines>
|
|
11
|
-
<platform name="ios">
|
|
11
|
+
<platform name="ios" package="swift">
|
|
12
12
|
<config-file parent="/*" target="config.xml">
|
|
13
13
|
<feature name="Purchasely">
|
|
14
14
|
<param name="ios-package" value="CDVPurchasely" />
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<source url="https://github.com/CocoaPods/Specs.git"/>
|
|
39
39
|
</config>
|
|
40
40
|
<pods use-frameworks="true">
|
|
41
|
-
<pod name="Purchasely" spec="6.0.
|
|
41
|
+
<pod name="Purchasely" spec="6.0.1" nospm="true"/>
|
|
42
42
|
</pods>
|
|
43
43
|
</podspec>
|
|
44
44
|
</platform>
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
<preference name="GradlePluginKotlinCodeStyle" value="official" />
|
|
54
54
|
</config-file>
|
|
55
55
|
<framework src="src/android/build-extras.gradle" custom="true" type="gradleReference" />
|
|
56
|
-
<framework src="io.purchasely:core:6.0.
|
|
56
|
+
<framework src="io.purchasely:core:6.0.2" />
|
|
57
57
|
<source-file src="src/android/PurchaselyPlugin.kt" target-dir="java/cordova/plugin/purchasely" />
|
|
58
58
|
</platform>
|
|
59
59
|
</plugin>
|
package/src/ios/CDVPurchasely.m
CHANGED
|
@@ -13,14 +13,20 @@
|
|
|
13
13
|
|
|
14
14
|
@implementation CDVPurchasely
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
// pluginInitialize is Cordova's setup hook and is called by every host, after
|
|
17
|
+
// viewController/webView/commandDelegate are assigned. The previous -init override was only
|
|
18
|
+
// reached on cordova-ios, whose -initWithWebViewEngine: calls [self init]; Capacitor's
|
|
19
|
+
// vendored CapacitorCordova calls [super init] instead, which dispatches to NSObject and
|
|
20
|
+
// never reaches a subclass override - so under Capacitor these collections stayed nil, and
|
|
21
|
+
// writing into a nil NSMutableDictionary/NSMutableArray is a silent no-op. That lost every
|
|
22
|
+
// interceptor callbackId (intercepted actions completed .notHandled without reaching JS) and
|
|
23
|
+
// every preloaded presentation ("Presentation not loaded" from preload/display).
|
|
24
|
+
- (void)pluginInitialize {
|
|
25
|
+
[super pluginInitialize];
|
|
18
26
|
|
|
19
27
|
self.presentationsLoaded = [NSMutableArray new];
|
|
20
28
|
self.actionInterceptorCallbackIds = [NSMutableDictionary new];
|
|
21
29
|
self.pendingInterceptCompletions = [NSMutableDictionary new];
|
|
22
|
-
|
|
23
|
-
return self;
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
- (void)start:(CDVInvokedUrlCommand*)command {
|
|
@@ -1266,6 +1272,18 @@ static BOOL PLYPresentationActionFromString(NSString *kind, PLYPresentationActio
|
|
|
1266
1272
|
} else if (presentation != nil) {
|
|
1267
1273
|
[self.presentationsLoaded addObject:presentation];
|
|
1268
1274
|
[self successFor:command resultDict:[self resultDictionaryForFetchPresentation:presentation]];
|
|
1275
|
+
} else {
|
|
1276
|
+
// Neither branch taken means the Cordova command is never completed and the
|
|
1277
|
+
// JS promise returned by preload() stays pending for the life of the page:
|
|
1278
|
+
// no resolve, no reject, no error, nothing logged. Answer instead, so the
|
|
1279
|
+
// caller can handle it.
|
|
1280
|
+
//
|
|
1281
|
+
// Purchasely 6.0.0 does not produce this pair (PresentationRequest.swift
|
|
1282
|
+
// maps a success-with-nil presentation to PLYError.presentationNotLoaded),
|
|
1283
|
+
// so this is defence in depth against a future SDK, not a fix for a
|
|
1284
|
+
// reproduced failure. It costs one branch and removes a whole class of
|
|
1285
|
+
// silent hang.
|
|
1286
|
+
[self failureFor:command resultString: @"Presentation preload completed without a presentation and without an error"];
|
|
1269
1287
|
}
|
|
1270
1288
|
}];
|
|
1271
1289
|
});
|
package/www/Purchasely.js
CHANGED
|
@@ -63,7 +63,7 @@ exports.start = function (options, success, error) {
|
|
|
63
63
|
var opts = options || {};
|
|
64
64
|
var cordovaSdkVersion = cordova.define.moduleMap['cordova/plugin_list'].exports['metadata']['cordova-plugin-purchasely']
|
|
65
65
|
if(!cordovaSdkVersion) {
|
|
66
|
-
cordovaSdkVersion = "6.0.
|
|
66
|
+
cordovaSdkVersion = "6.0.1";
|
|
67
67
|
}
|
|
68
68
|
opts.sdkVersion = cordovaSdkVersion;
|
|
69
69
|
exec(success, error, 'Purchasely', 'start', [opts]);
|