Skip to content

Commit 2af722a

Browse files
committed
fix ios build
1 parent f4f40a2 commit 2af722a

File tree

5 files changed

+28
-5
lines changed

5 files changed

+28
-5
lines changed

App_Resources/Android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="org.exarhteam.iitc_prime"
3+
package="org.exarhteam.iitcprime"
44
android:versionCode="10000"
55
android:versionName="1.0">
66

app/components/PopupWebView.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,14 @@ export default {
106106
if (this.transport) {
107107
const transport = this.transport.obj;
108108
transport?.setWebView(webview.android);
109-
this.transport.sendToTarget();
109+
110+
try {
111+
if (transport && transport.getWebView()) {
112+
this.transport.sendToTarget();
113+
}
114+
} catch (error) {
115+
console.error('Error sending transport message:', error);
116+
}
110117
}
111118
}
112119
}

app/utils/webview/base-chrome-client.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { isAndroid } from "@nativescript/core";
2+
13
/**
24
* WebView chrome client implementation
35
*/
4-
export const BaseWebChromeClient = android.webkit.WebChromeClient.extend({
6+
export const BaseWebChromeClient = isAndroid ? android.webkit.WebChromeClient.extend({
57
init: function () {},
68

79
initWithComponent: function(component) {
@@ -50,4 +52,14 @@ export const BaseWebChromeClient = android.webkit.WebChromeClient.extend({
5052
cleanup: function() {
5153
this.component = null;
5254
}
53-
});
55+
}) : class BaseWebChromeClient {
56+
init() {}
57+
58+
initWithComponent(component) {
59+
this.component = component;
60+
}
61+
62+
cleanup() {
63+
this.component = null;
64+
}
65+
};

nativescript.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { NativeScriptConfig } from '@nativescript/core';
22

33
export default {
4-
id: 'org.exarhteam.iitc_prime',
4+
id: 'org.exarhteam.iitcprime',
55
appPath: 'app',
66
appResourcesPath: 'App_Resources',
77
android: {
88
v8Flags: '--expose_gc',
99
markingMode: 'none'
10+
},
11+
ios: {
12+
deploymentTarget: '13.0'
1013
}
1114
} as NativeScriptConfig;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
},
4343
"devDependencies": {
4444
"@nativescript/android": "^8.8.5",
45+
"@nativescript/ios": "8.9.2",
4546
"@nativescript/webpack": "~5.0.22",
4647
"@triniwiz/nativescript-socketio": "^4.0.1",
4748
"nativescript-vue-template-compiler": "^2.9.3",

0 commit comments

Comments
 (0)