nhn / gpm.unity

A brand of NHN providing free services required for game development.

Home Page:https://gameplatform.nhncloud.com/en/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automate iOS setup of WebView

unobatbayar opened this issue · comments

Hello,

Sorry to bother again, we want to really use this package, however we use CI/CD server and we can't manually setup Xcode after building.

It possible to automate iOS setup process?

Screenshot 2022-12-27 at 14 19 12

we really need to automate adding of GPMWebView.bundle to Copy Resources Bundle but had no luck in BuildProcessor scripts because on iOS the WebView buttons don't appear/

Hello. @unobatbayar.

Depending on the Unity version, it may be added or skipped, so it is difficult to apply in common.
Please refer to the Unity OnPostprocessBuild and PBXProject class to add a GPMWebView.bundle to a specific Unity version.

If you have any questions, please feel free to contact us.
Thank you.

I understand, thank you

I got it!

In OnPostprocessBuild() add

// Add linker
pbxProject.AddBuildProperty(appGuid, "OTHER_LDFLAGS", "-ObjC");

// Add bundle
var webViewBundleGuid = pbxProject.AddFile("Frameworks/GPM/WebView/Plugins/IOS/GPMWebView.bundle", "GPMWebView.bundle", PBXSourceTree.Build);  
pbxProject.AddFileToBuild(appGuid, webViewBundleGuid);

Everything will be already added in Xcode 👍

Screenshot 2022-12-28 at 10 52 50

Screenshot 2022-12-28 at 10 33 20