mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 02:54:11 +08:00
fix(Connectivity): androidApp is not defined on SDK <28 (#10324)
fixes #10323 Co-authored-by: Nathan Walker <walkerrunpdx@gmail.com>
This commit is contained in:
@ -109,8 +109,7 @@ function startMonitoringLegacy(connectionTypeChangedCallback) {
|
||||
connectionTypeChangedCallback(newConnectionType);
|
||||
};
|
||||
const zoneCallback = zonedCallback(onReceiveCallback);
|
||||
// @ts-ignore
|
||||
androidApp.registerBroadcastReceiver(android.net.ConnectivityManager.CONNECTIVITY_ACTION, zoneCallback);
|
||||
Application.android.registerBroadcastReceiver(android.net.ConnectivityManager.CONNECTIVITY_ACTION, zoneCallback);
|
||||
}
|
||||
|
||||
let callback;
|
||||
|
4
packages/core/global-types.d.ts
vendored
4
packages/core/global-types.d.ts
vendored
@ -103,7 +103,7 @@ declare module globalThis {
|
||||
function _isModuleLoadedForUI(moduleName: string): boolean;
|
||||
|
||||
var onGlobalLayoutListener: any;
|
||||
function zonedCallback(callback: Function): Function;
|
||||
function zonedCallback<T = Function>(callback: T): T;
|
||||
var Reflect: any;
|
||||
function Deprecated(target: Object, key?: string | symbol, descriptor?: any): any;
|
||||
function Experimental(target: Object, key?: string | symbol, descriptor?: any): any;
|
||||
@ -358,7 +358,7 @@ declare function fail(data: any): void;
|
||||
*/
|
||||
// declare function clearInterval(id: number): void;
|
||||
|
||||
declare function zonedCallback(callback: Function): Function;
|
||||
declare function zonedCallback<T = Function>(callback: T): T;
|
||||
|
||||
/**
|
||||
* Create a Java long from a number
|
||||
|
Reference in New Issue
Block a user