Skip to content

Commit 945be8a

Browse files
authored
fix(ios): correc path overrides (#78)
1 parent 3970e5f commit 945be8a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"hooks": [
1313
{
14-
"type": "before-prepare",
14+
"type": "after-prepare",
1515
"script": "scripts/ios/appsync-ios.js",
1616
"inject": true
1717
},

src/scripts/ios/appsync-ios.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ function patchUIApplicationMain(iosProjectFolder) {
1919
// let's first inject a header we need
2020
replaceInFile(
2121
appSyncFileDest,
22-
'#include <NativeScript/NativeScript.h>',
23-
'#include <NativeScript/NativeScript.h>\n#include <AppSync/TNSAppSync.h>'
22+
'#import <NativeScript/NativeScript.h>',
23+
'#import <NativeScript/NativeScript.h>\n#import <AppSync/TNSAppSync.h>'
2424
);
2525

2626
// now inject the function call that determines the correct application path (either default or appsync'ed)
2727
replaceInFile(
2828
appSyncFileDest,
29-
'applicationPath = [NSBundle mainBundle].bundlePath;',
30-
'applicationPath = [TNSAppSync applicationPathWithDefault:[NSBundle mainBundle].bundlePath];'
29+
'[[NSBundle mainBundle] resourcePath]',
30+
'[TNSAppSync applicationPathWithDefault:[[NSBundle mainBundle] resourcePath]]'
3131
);
3232
}
3333

@@ -49,4 +49,4 @@ module.exports = function ($injector, hookArgs) {
4949
const iosProjectFolder = prepareHooksHelper.getNativeProjectDir($injector, platform, hookArgs);
5050
patchUIApplicationMain(iosProjectFolder);
5151
}
52-
};
52+
};

0 commit comments

Comments
 (0)