Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

Cannot receive URL Scheme with App not running

$
0
0
Hi.I made a iOS app to receive URL Scheme from Browser and show URL. But sometimes not works.(Launch App is always no problem, but cannot receive URL) Can you help me? Suspend or Background -> fine Not running -> bad UrlReceiver.cs (Attach with Empty Object) public class UrlReceiver : MonoBehaviour { public Text text; void OnOpenUrl(string url){ text.text = url; } } UnitySchemeController.mm #import "UnityAppController.h" void UnitySendMessage(const char* objName, const char* methodName, const char* param); char* MakeStringUrl(const char* string) { if (string == NULL) return NULL; char* res = (char*)malloc(strlen(string) + 1); strcpy(res, string); return res; } @interface UnitySchemeController : UnityAppController{ } @end @implementation UnitySchemeController -(BOOL) application:(nonnull UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary *)options { NSString* message = [url absoluteString]; UnitySendMessage("UrlReceiver", "OnOpenUrl", MakeStringUrl([message UTF8String])); return YES; } @end IMPL_APP_CONTROLLER_SUBCLASS(UnitySchemeController)

Viewing all articles
Browse latest Browse all 4709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>