I want to send text messages in the app that are links to open other views inside the same app. Like a notification text message which has links to other views in app. So the best way to go about this is to insert the URL scheme myAppName://someQuery?blablabla=123
and that should in turn fire the openURL
command and open that specific view.
What is the best practice to hide the url scheme from the end user. It looks ugly and also don't want to create the possibility where end user can pass in values to the url scheme.
My options:
<a href=myAppName://someQuery?blablabla=123">Test</a>
, but this takes a hit on performance as I need to keep assigning attributed text to the textView, and that is super slow, and buggy.So far, the best option I have it 2. Just wondering if there are other good ideas out there...
Thanks for the help
Custom URL schemes provide a way to reference resources inside your app. Users tapping a custom URL in an email, for example, launch your app in a specified context. Other apps can also trigger your app to launch with specific context data; for example, a photo library app might display a specified image.
The URL scheme is an interesting feature provided by the iOS SDK that allows developers to launch system apps and third-party apps through URLs. For example, let's say your app displays a phone number, and you want to make a call whenever a user taps that number.
Go to the Play store, find the app and view its page. Copy the URL from the browser address bar. Make a note of this as the "Android Fallback URL." You'll see a parameter called "id" followed by an equal sign (=).
You can encrypt your parameters string and then send it as a message
Encrypted URL form:
myAppName://encrypted_query
Now when you get a call in your app, you should fetch the encryptedt_data
out of the URL and should decrypt it before actually doing anything.
Decrypted URL form:
myAppName://someQuery?blablabla=123
In my believe this is the best and easiest way to get this done. For encryption/decryption best practice check this, AES Encryption for an NSString on the iPhone and this.
As long as you're not concern about the security, you can always use reduced size of encryption string to make a URL smaller. That option is given in Github library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With