Skip to content

Commit

Permalink
fix(android/ios): expose getPlatform method in Capacitor object (#1766)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Jul 17, 2019
1 parent c91cfb9 commit 7f7b7b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/native-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@
return url;
}

/*
* Check running platform
*/
capacitor.getPlatform = function getPlatform() {
return this.platform;
}

/**
* Send a plugin method call to the native layer
*/
Expand Down
1 change: 1 addition & 0 deletions core/src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export interface Capacitor {
platform?: string;
isPluginAvailable: (name: string) => boolean;
convertFileSrc:(filePath: string) => string;
getPlatform:() => string;
toNative?: (pluginId: string, methodName: string, options: any, storedCallback?: StoredCallback) => void;
fromNative?: (result: PluginResult) => void;
withPlugin?: (pluginId: string, fn: Function) => void;
Expand Down

0 comments on commit 7f7b7b1

Please sign in to comment.