Android Notification add permission
This commit is contained in:
2
doric-js/index.d.ts
vendored
2
doric-js/index.d.ts
vendored
@@ -926,12 +926,14 @@ declare module 'doric/lib/src/native/notification' {
|
||||
name: string;
|
||||
data?: object;
|
||||
androidSystem?: boolean;
|
||||
permission?: string;
|
||||
}) => Promise<any>;
|
||||
subscribe: (args: {
|
||||
biz?: string | undefined;
|
||||
name: string;
|
||||
callback: (data?: any) => void;
|
||||
androidSystem?: boolean | undefined;
|
||||
permission?: string | undefined;
|
||||
}) => Promise<string>;
|
||||
unsubscribe: (subscribeId: string) => Promise<any>;
|
||||
};
|
||||
|
2
doric-js/lib/src/native/notification.d.ts
vendored
2
doric-js/lib/src/native/notification.d.ts
vendored
@@ -5,12 +5,14 @@ export declare function notification(context: BridgeContext): {
|
||||
name: string;
|
||||
data?: object;
|
||||
androidSystem?: boolean;
|
||||
permission?: string;
|
||||
}) => Promise<any>;
|
||||
subscribe: (args: {
|
||||
biz?: string | undefined;
|
||||
name: string;
|
||||
callback: (data?: any) => void;
|
||||
androidSystem?: boolean | undefined;
|
||||
permission?: string | undefined;
|
||||
}) => Promise<string>;
|
||||
unsubscribe: (subscribeId: string) => Promise<any>;
|
||||
};
|
||||
|
@@ -16,13 +16,13 @@
|
||||
import { BridgeContext } from "../runtime/global"
|
||||
export function notification(context: BridgeContext) {
|
||||
return {
|
||||
publish: (args: { biz?: string, name: string, data?: object, androidSystem?: boolean }) => {
|
||||
publish: (args: { biz?: string, name: string, data?: object, androidSystem?: boolean, permission?: string }) => {
|
||||
if (args.data !== undefined) {
|
||||
(args as any).data = JSON.stringify(args.data)
|
||||
}
|
||||
return context.callNative('notification', 'publish', args)
|
||||
},
|
||||
subscribe: (args: { biz?: string, name: string, callback: (data?: any) => void, androidSystem?: boolean }) => {
|
||||
subscribe: (args: { biz?: string, name: string, callback: (data?: any) => void, androidSystem?: boolean, permission?: string }) => {
|
||||
(args as any).callback = context.function2Id(args.callback)
|
||||
return context.callNative('notification', 'subscribe', args) as Promise<string>
|
||||
},
|
||||
|
Reference in New Issue
Block a user