@purchasely/cordova-plugin-purchasely 6.0.0-rc.3 → 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/README.md +22 -14
- package/package.json +11 -2
- package/plugin.xml +4 -4
- package/src/android/PurchaselyPlugin.kt +247 -67
- package/src/ios/CDVPurchasely+Events.m +7 -1
- package/src/ios/CDVPurchasely.h +11 -0
- package/src/ios/CDVPurchasely.m +180 -10
- package/src/ios/Hybrid/PLYPlan+Hybrid.m +19 -0
- package/src/ios/Hybrid/PLYSubscription+Hybrid.m +13 -0
- package/www/Purchasely.js +390 -46
- package/__tests__/Purchasely.test.js +0 -1161
- 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 -70
- package/example/e2e/package.json +0 -19
- package/example/e2e/specs/bridge.e2e.js +0 -51
- package/example/e2e/specs/dismiss.e2e.js +0 -37
- package/example/e2e/tools/ci_run_e2e.sh +0 -49
- package/example/e2e/tools/ci_run_e2e_ios.sh +0 -46
- package/example/e2e/wdio.android.conf.js +0 -21
- package/example/e2e/wdio.ios.conf.js +0 -19
- package/example/e2e/wdio.shared.conf.js +0 -28
- package/example/ios.sh +0 -16
- 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 -449
- 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/README.md
CHANGED
|
@@ -29,24 +29,32 @@ Purchasely.start(
|
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
31
|
|
|
32
|
-
Purchasely.
|
|
33
|
-
'
|
|
34
|
-
'my_content_id'
|
|
35
|
-
|
|
36
|
-
(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
Purchasely.presentation
|
|
33
|
+
.placement('my_placement_id') // or .screen('my_presentation_id'), .defaultSource()
|
|
34
|
+
.contentId('my_content_id') // may be omitted
|
|
35
|
+
.build()
|
|
36
|
+
.display(Purchasely.TransitionType.fullScreen) // display mode
|
|
37
|
+
.then((outcome) => {
|
|
38
|
+
console.log(outcome);
|
|
39
|
+
if (outcome.purchaseResult === 'purchased') {
|
|
40
|
+
console.log("User purchased " + outcome.plan.name);
|
|
41
|
+
} else if (outcome.purchaseResult === 'cancelled') {
|
|
42
|
+
console.log("User cancelled purchase");
|
|
40
43
|
} else {
|
|
41
|
-
console.log("
|
|
44
|
+
console.log("Dismissed", outcome.closeReason);
|
|
42
45
|
}
|
|
43
|
-
}
|
|
44
|
-
(error) => {
|
|
45
|
-
console.log("Error with purchase : " + error);
|
|
46
|
-
}
|
|
47
|
-
);
|
|
46
|
+
});
|
|
48
47
|
```
|
|
49
48
|
|
|
49
|
+
## Limitations
|
|
50
|
+
|
|
51
|
+
- **No inline/embedded paywall view.** iOS, Android, Flutter and React Native all support
|
|
52
|
+
embedding a paywall directly inside a screen (`PLYPresentationView` / `buildView` /
|
|
53
|
+
`getFragment`). This is not available on Cordova: the plugin only supports
|
|
54
|
+
modal/fullscreen/push presentation via the presentation builder
|
|
55
|
+
(`Purchasely.presentation.…build().display()`). Embedding a native view inside the WebView
|
|
56
|
+
isn't supported by this bridge architecture; this is an accepted platform limitation, not a bug.
|
|
57
|
+
|
|
50
58
|
## 🏁 Documentation
|
|
51
59
|
|
|
52
60
|
A complete documentation is available on our website [https://docs.purchasely.com](https://docs.purchasely.com/quick-start/sdk-installation/cordova)
|
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>
|