mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-30 00:29:46 +08:00
feat(ios): upgrade button in setting (#13645)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - New Features - Added a Subscription section in Mobile Settings (for signed-in users) with plan info and an Upgrade button that opens the native paywall. - Supports showing “Pro” and “AI” paywalls. - Integrated native paywall provider on iOS. - Style - Introduced new styling for the subscription card, content, and button. - Localization - Added English strings for subscription title, description, and button. - Chores - Minor iOS project cleanup and internal wiring to enable the paywall module. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -44,6 +44,7 @@ import { configureNavigationPanelModule } from './navigation-panel';
|
||||
import { configureNotificationModule } from './notification';
|
||||
import { configureOpenInApp } from './open-in-app';
|
||||
import { configureOrganizeModule } from './organize';
|
||||
import { configurePaywallModule } from './paywall';
|
||||
import { configurePDFModule } from './pdf';
|
||||
import { configurePeekViewModule } from './peek-view';
|
||||
import { configurePermissionsModule } from './permissions';
|
||||
@@ -130,4 +131,5 @@ export function configureCommonModules(framework: Framework) {
|
||||
configureIndexerEmbeddingModule(framework);
|
||||
configureCommentModule(framework);
|
||||
configureDocSummaryModule(framework);
|
||||
configurePaywallModule(framework);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import type { Framework } from '@toeverything/infra';
|
||||
|
||||
import { NativePaywallService } from './services/native-paywall';
|
||||
|
||||
export { NativePaywallProvider } from './providers/native-paywall';
|
||||
export { NativePaywallService } from './services/native-paywall';
|
||||
|
||||
export function configurePaywallModule(framework: Framework) {
|
||||
framework.service(NativePaywallService);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { createIdentifier } from '@toeverything/infra';
|
||||
|
||||
export interface NativePaywallProvider {
|
||||
showPaywall(type: 'Pro' | 'AI'): Promise<void>;
|
||||
}
|
||||
|
||||
export const NativePaywallProvider = createIdentifier<NativePaywallProvider>(
|
||||
'NativePaywallProvider'
|
||||
);
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Service } from '@toeverything/infra';
|
||||
|
||||
import { NativePaywallProvider } from '../providers/native-paywall';
|
||||
|
||||
export class NativePaywallService extends Service {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
getNativePaywallProvider() {
|
||||
return this.framework.getOptional(NativePaywallProvider);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user