mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 22:01:42 +08:00
Merge branch 'master' of github.com:NativeScript/NativeScript
This commit is contained in:
@ -111,6 +111,10 @@ export class AndroidApplication extends Observable implements AndroidApplication
|
||||
this._systemAppearance = value;
|
||||
}
|
||||
|
||||
public getRegisteredBroadcastReceiver(intentFilter: string): android.content.BroadcastReceiver | undefined {
|
||||
return this._registeredReceivers[intentFilter];
|
||||
}
|
||||
|
||||
public registerBroadcastReceiver(intentFilter: string, onReceiveCallback: (context: android.content.Context, intent: android.content.Intent) => void): void {
|
||||
ensureBroadCastReceiverClass();
|
||||
const registerFunc = (context: android.content.Context) => {
|
||||
|
6
packages/core/application/index.d.ts
vendored
6
packages/core/application/index.d.ts
vendored
@ -628,6 +628,12 @@ export class AndroidApplication extends Observable {
|
||||
*/
|
||||
public static activityRequestPermissionsEvent: string;
|
||||
|
||||
/**
|
||||
* Get a registered BroadcastReceiver, then you can get the result code of BroadcastReceiver in onReceiveCallback method.
|
||||
* @param intentFilter A string containing the intent filter.
|
||||
*/
|
||||
public getRegisteredBroadcastReceiver(intentFilter: string): android.content.BroadcastReceiver | undefined;
|
||||
|
||||
/**
|
||||
* Register a BroadcastReceiver to be run in the main activity thread. The receiver will be called with any broadcast Intent that matches filter, in the main application thread.
|
||||
* For more information, please visit 'http://developer.android.com/reference/android/content/Context.html#registerReceiver%28android.content.BroadcastReceiver,%20android.content.IntentFilter%29'
|
||||
|
@ -6,11 +6,11 @@ export function uptime() {
|
||||
return global.android ? (<any>org).nativescript.Process.getUpTime() : (<any>global).__tns_uptime();
|
||||
}
|
||||
|
||||
export function log(message: string): void {
|
||||
export function log(message: string, ...optionalParams: any[]): void {
|
||||
if ((<any>global).__nslog) {
|
||||
(<any>global).__nslog('CONSOLE LOG: ' + message);
|
||||
}
|
||||
console.log(message);
|
||||
console.log(message, ...optionalParams);
|
||||
}
|
||||
|
||||
export type InstrumentationMode = 'counters' | 'timeline' | 'lifecycle';
|
||||
|
Reference in New Issue
Block a user