Welcome! › Forums › Unity Plugins › In-App Web Browser › App is getting crashed on iOS with this plugin
- This topic has 8 replies, 2 voices, and was last updated 7 years, 7 months ago by
vivekkalkur.
-
AuthorPosts
-
July 4, 2017 at 11:37 am #242
vivekkalkur
ParticipantHi Piotr!
Greetings from Vivek! I had downloaded your plugin for implementing in one of my applications for iOS. But I can see that my app is getting crashed and I am getting this error(attached image) in my XCode. Could you please let me know the possible issue and solve it?July 4, 2017 at 12:14 pm #243Piotr
KeymasterHi,
Cannot really figure out what’s going on.
Could you send me exact code you are executing from Unity?
I guess it’s happening just after website finishes loading?July 4, 2017 at 12:21 pm #245vivekkalkur
Participantpublic class FirstPersonController : MonoBehaviour
{
public string MensJacketPage = “https://www.target.com/c/jackets-coats-men-s-clothing/-/N-5xu2a”;private void Update () {
if (hit.transform.name == “Men_Jacket”) {
InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
options.displayURLAsPageTitle = false;
options.pinchAndZoomEnabled = true;
options.pageTitle = “Digital VR Store”;
InAppBrowser.OpenURL(MensJacketPage, options);
}
}
}
In the above code,there is a game object called “Men_Jacket” and whenever I click on it, I am trying to open it your browser.I am integrating this with my firstpersonController script,FYI.July 4, 2017 at 5:17 pm #246Piotr
KeymasterHmm isn’t OpenURL called more than once in really short time?
Could you wrap code for opening browser withinif (!InAppBrowser.IsInAppBrowserOpened()) { // open your website... }
Let me know if that helped.
July 5, 2017 at 5:18 am #247vivekkalkur
ParticipantNo luck here. I tried with the above code :
public class FirstPersonController : MonoBehaviour
{
public string MensJacketPage = “https://www.target.com/c/jackets-coats-men-s-clothing/-/N-5xu2a”;private void Update () {
if (hit.transform.name == “Men_Jacket”) {
InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
options.displayURLAsPageTitle = false;
options.pinchAndZoomEnabled = true;
options.pageTitle = “Digital VR Store”;
if (!InAppBrowser.IsInAppBrowserOpened()) {
InAppBrowser.OpenURL(MensJacketPage, options);
}
}
}
}July 5, 2017 at 6:58 pm #248Piotr
KeymasterHmm. Interesting.
Is it happening when you are trying to open http://www.google.com?July 6, 2017 at 6:09 am #249vivekkalkur
ParticipantYes,it is happening the same even with, http://www.google.com
-
This reply was modified 7 years, 7 months ago by
vivekkalkur.
July 6, 2017 at 10:20 am #251Piotr
KeymasterIn that case, it seems that
OpenURL
is called multiple times (every frame) and causes subsequent calls to clash. Could you put Debug.Log before OpenURL method and check if that’s true?
If so – can you put your own boolean flag, like isShowingBrowser and set it true after first call and then check if it’s set before opening browser?July 6, 2017 at 11:27 am #252vivekkalkur
ParticipantHey piotr,
You know what, I upgraded my Xcode from 8.2.1 to 8.3.3 and now everything is working fine.I knew that it was a dangling pointer and the object was getting released multiple times but then I just though why don’t I upgrade my Xcode and check. Whoa maybe my luck was good! 😀 Anyways,thanks for your reply! It’s a great plugin!!! I wish it had a control to screen layout(width and height) rather than a full screen. Hope to see that soon though!Thanks
-
This reply was modified 7 years, 7 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.