How to take the parameter from URL scheme.

前端 未结 3 1095
死守一世寂寞
死守一世寂寞 2021-02-06 17:49

I am using URL scheme in my iPhone app,from a page I switch user to safari,and a button click from Web page,I am reverting back to app At that time ,some parameters are passed b

3条回答
  •  无人及你
    2021-02-06 18:06

    You can use this url host to find out the parameters, where parameters could be of any kind, anything after http:// or custom tag custom:// will be caught in the following code

     NSString *urlParameter = [[url host] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    

    If you have multiple parameters then you could use componentsSeparatedByString method to separate the parameters

提交回复
热议问题