@virex-tech/paywallo-sdk 1.0.0 → 1.1.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/LICENSE +1 -1
- package/{MonetySdk.podspec → PaywalloSdk.podspec} +4 -4
- package/README.md +19 -19
- package/android/build.gradle +1 -1
- package/dist/index.d.mts +1 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.js +202 -152
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +202 -152
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -5
- package/react-native.config.js +3 -3
- package/android/src/main/java/com/monety/sdk/MonetySdkPackage.kt +0 -16
- package/android/src/main/java/com/monety/sdk/PanelStoreKitModule.kt +0 -315
- package/android/src/main/java/com/monety/sdk/PanelWebView.kt +0 -74
- package/android/src/main/java/com/monety/sdk/PanelWebViewManager.kt +0 -52
- package/ios/PanelStoreKit.m +0 -21
- package/ios/PanelStoreKit.swift +0 -245
- package/ios/PanelWebView.h +0 -15
- package/ios/PanelWebView.m +0 -182
- package/ios/PanelWebViewManager.m +0 -41
- package/ios/PanelWebViewModule.h +0 -8
- package/ios/PanelWebViewModule.m +0 -42
package/LICENSE
CHANGED
|
@@ -3,14 +3,14 @@ require 'json'
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
4
|
|
|
5
5
|
Pod::Spec.new do |s|
|
|
6
|
-
s.name = "
|
|
6
|
+
s.name = "PaywalloSdk"
|
|
7
7
|
s.version = package['version']
|
|
8
8
|
s.summary = package['description']
|
|
9
|
-
s.homepage = "https://github.com/
|
|
9
|
+
s.homepage = "https://github.com/paywallo/sdk-react-native"
|
|
10
10
|
s.license = package['license']
|
|
11
|
-
s.authors = { "
|
|
11
|
+
s.authors = { "Paywallo" => "support@paywallo.io" }
|
|
12
12
|
s.platforms = { :ios => "15.0" }
|
|
13
|
-
s.source = { :git => "https://github.com/
|
|
13
|
+
s.source = { :git => "https://github.com/paywallo/sdk-react-native.git", :tag => "v#{s.version}" }
|
|
14
14
|
s.source_files = "ios/**/*.{h,m,swift}"
|
|
15
15
|
s.frameworks = "WebKit", "StoreKit"
|
|
16
16
|
s.swift_version = "5.5"
|
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @virex-tech/paywallo-sdk
|
|
2
2
|
|
|
3
|
-
SDK oficial para integração com
|
|
3
|
+
SDK oficial para integração com Paywallo em aplicações React Native. Oferece Analytics, Feature Flags, Paywalls dinâmicas e gerenciamento de In-App Purchases.
|
|
4
4
|
|
|
5
5
|
## Instalação
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @
|
|
8
|
+
npm install @virex-tech/paywallo-sdk
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
### Peer Dependencies
|
|
@@ -40,18 +40,18 @@ cd ios && pod install
|
|
|
40
40
|
### 1. Configure o Provider
|
|
41
41
|
|
|
42
42
|
```tsx
|
|
43
|
-
import {
|
|
43
|
+
import { PaywalloProvider } from '@virex-tech/paywallo-sdk';
|
|
44
44
|
|
|
45
45
|
export default function App() {
|
|
46
46
|
return (
|
|
47
|
-
<
|
|
47
|
+
<PaywalloProvider
|
|
48
48
|
config={{
|
|
49
49
|
appKey: 'sua_app_key',
|
|
50
50
|
debug: __DEV__,
|
|
51
51
|
}}
|
|
52
52
|
>
|
|
53
53
|
<YourApp />
|
|
54
|
-
</
|
|
54
|
+
</PaywalloProvider>
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
```
|
|
@@ -59,10 +59,10 @@ export default function App() {
|
|
|
59
59
|
### 2. Use os Hooks
|
|
60
60
|
|
|
61
61
|
```tsx
|
|
62
|
-
import {
|
|
62
|
+
import { usePaywallo, useSubscription } from '@virex-tech/paywallo-sdk';
|
|
63
63
|
|
|
64
64
|
function MyComponent() {
|
|
65
|
-
const { presentPaywall, hasActiveSubscription } =
|
|
65
|
+
const { presentPaywall, hasActiveSubscription } = usePaywallo();
|
|
66
66
|
const { subscription } = useSubscription();
|
|
67
67
|
|
|
68
68
|
const handlePurchase = async () => {
|
|
@@ -82,17 +82,17 @@ function MyComponent() {
|
|
|
82
82
|
|
|
83
83
|
## API Principal
|
|
84
84
|
|
|
85
|
-
###
|
|
85
|
+
### PaywalloProvider
|
|
86
86
|
|
|
87
87
|
Provider que inicializa o SDK e disponibiliza o contexto para toda a aplicação.
|
|
88
88
|
|
|
89
89
|
```tsx
|
|
90
|
-
<
|
|
90
|
+
<PaywalloProvider config={PaywalloConfig}>
|
|
91
91
|
{children}
|
|
92
|
-
</
|
|
92
|
+
</PaywalloProvider>
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
###
|
|
95
|
+
### usePaywallo()
|
|
96
96
|
|
|
97
97
|
Hook principal com acesso a todas as funcionalidades:
|
|
98
98
|
|
|
@@ -111,27 +111,27 @@ Hook para gerenciamento de assinaturas:
|
|
|
111
111
|
- `isLoading` - Estado de carregamento
|
|
112
112
|
- `refresh()` - Atualiza dados da assinatura
|
|
113
113
|
|
|
114
|
-
###
|
|
114
|
+
### PaywalloClient (API Imperativa)
|
|
115
115
|
|
|
116
116
|
Para uso fora de componentes React:
|
|
117
117
|
|
|
118
118
|
```tsx
|
|
119
|
-
import {
|
|
119
|
+
import { PaywalloClient } from '@virex-tech/paywallo-sdk';
|
|
120
120
|
|
|
121
121
|
// Identificar usuário
|
|
122
|
-
await
|
|
122
|
+
await PaywalloClient.identify('user_123', { email: 'user@example.com' });
|
|
123
123
|
|
|
124
124
|
// Rastrear evento
|
|
125
|
-
await
|
|
125
|
+
await PaywalloClient.track('purchase_completed', { product: 'premium' });
|
|
126
126
|
|
|
127
127
|
// Feature Flags
|
|
128
|
-
const variant = await
|
|
128
|
+
const variant = await PaywalloClient.getVariant('new_feature');
|
|
129
129
|
```
|
|
130
130
|
|
|
131
131
|
## Tipos
|
|
132
132
|
|
|
133
133
|
```tsx
|
|
134
|
-
interface
|
|
134
|
+
interface PaywalloConfig {
|
|
135
135
|
appKey: string;
|
|
136
136
|
baseUrl?: string;
|
|
137
137
|
debug?: boolean;
|
|
@@ -157,7 +157,7 @@ interface PaywallResult {
|
|
|
157
157
|
|
|
158
158
|
## Suporte
|
|
159
159
|
|
|
160
|
-
Para dúvidas ou problemas, entre em contato com o suporte
|
|
160
|
+
Para dúvidas ou problemas, entre em contato com o suporte Paywallo.
|
|
161
161
|
|
|
162
162
|
## Licença
|
|
163
163
|
|
package/android/build.gradle
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -246,7 +246,6 @@ interface RestoreResult {
|
|
|
246
246
|
type Environment = "Production" | "Sandbox";
|
|
247
247
|
interface ApiClientConfig {
|
|
248
248
|
appKey: string;
|
|
249
|
-
baseUrl?: string;
|
|
250
249
|
debug?: boolean;
|
|
251
250
|
environment?: Environment;
|
|
252
251
|
offlineQueueEnabled?: boolean;
|
|
@@ -254,7 +253,6 @@ interface ApiClientConfig {
|
|
|
254
253
|
}
|
|
255
254
|
interface PaywalloConfig {
|
|
256
255
|
appKey: string;
|
|
257
|
-
baseUrl?: string;
|
|
258
256
|
debug?: boolean;
|
|
259
257
|
environment?: Environment;
|
|
260
258
|
}
|
|
@@ -459,7 +457,7 @@ declare class ApiClient {
|
|
|
459
457
|
private offlineQueueEnabled;
|
|
460
458
|
private httpClient;
|
|
461
459
|
private readonly cache;
|
|
462
|
-
constructor(appKey: string,
|
|
460
|
+
constructor(appKey: string, debug?: boolean, environment?: Environment, offlineQueueEnabled?: boolean, timeout?: number);
|
|
463
461
|
/** Exposed only for QueueProcessor initialization. Prefer get()/post() for requests. */
|
|
464
462
|
getHttpClient(): HttpClient;
|
|
465
463
|
getWebUrl(): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -246,7 +246,6 @@ interface RestoreResult {
|
|
|
246
246
|
type Environment = "Production" | "Sandbox";
|
|
247
247
|
interface ApiClientConfig {
|
|
248
248
|
appKey: string;
|
|
249
|
-
baseUrl?: string;
|
|
250
249
|
debug?: boolean;
|
|
251
250
|
environment?: Environment;
|
|
252
251
|
offlineQueueEnabled?: boolean;
|
|
@@ -254,7 +253,6 @@ interface ApiClientConfig {
|
|
|
254
253
|
}
|
|
255
254
|
interface PaywalloConfig {
|
|
256
255
|
appKey: string;
|
|
257
|
-
baseUrl?: string;
|
|
258
256
|
debug?: boolean;
|
|
259
257
|
environment?: Environment;
|
|
260
258
|
}
|
|
@@ -459,7 +457,7 @@ declare class ApiClient {
|
|
|
459
457
|
private offlineQueueEnabled;
|
|
460
458
|
private httpClient;
|
|
461
459
|
private readonly cache;
|
|
462
|
-
constructor(appKey: string,
|
|
460
|
+
constructor(appKey: string, debug?: boolean, environment?: Environment, offlineQueueEnabled?: boolean, timeout?: number);
|
|
463
461
|
/** Exposed only for QueueProcessor initialization. Prefer get()/post() for requests. */
|
|
464
462
|
getHttpClient(): HttpClient;
|
|
465
463
|
getWebUrl(): string;
|