init
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
export interface PromoCodePlugin {
|
||||
echo(options: { value: string }): Promise<{ value: string }>;
|
||||
}
|
||||
launchPromoCodeRedemptionFlow(): Promise<{ success: boolean; message?: string }>;
|
||||
isPromoCodeSupported(): Promise<{ supported: boolean }>;
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
import { registerPlugin } from '@capacitor/core';
|
||||
|
||||
import type { PromoCodePlugin } from './definitions';
|
||||
|
||||
const PromoCode = registerPlugin<PromoCodePlugin>('PromoCode', {
|
||||
web: () => import('./web').then((m) => new m.PromoCodeWeb()),
|
||||
web: () => import('./web').then(m => new m.PromoCodeWeb()),
|
||||
});
|
||||
|
||||
export * from './definitions';
|
||||
export { PromoCode };
|
||||
export { PromoCode };
|
||||
16
src/web.ts
16
src/web.ts
@@ -3,8 +3,16 @@ import { WebPlugin } from '@capacitor/core';
|
||||
import type { PromoCodePlugin } from './definitions';
|
||||
|
||||
export class PromoCodeWeb extends WebPlugin implements PromoCodePlugin {
|
||||
async echo(options: { value: string }): Promise<{ value: string }> {
|
||||
console.log('ECHO', options);
|
||||
return options;
|
||||
async launchPromoCodeRedemptionFlow(): Promise<{ success: boolean; message?: string }> {
|
||||
return {
|
||||
success: false,
|
||||
message: 'Promo code redemption is not supported on web',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async isPromoCodeSupported(): Promise<{ supported: boolean }> {
|
||||
return {
|
||||
supported: false,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user