linkedin / linkedin/linkedin.github.com

[iOS] While passing the LinkedIn profile url to open the LinkedIn profile in LinkedIn app, it's opening in web

Ouverte
#27 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
JavaScript
Étoiles
67
Forks
50
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I want to open the profile of LinkedIn in LinkedIn app if app is installed otherwise in web. So, I added the code like this:

if let linkedIn = "https://www.linkedin.com/in/prakashiyerleadershipcoach" {
                            guard let linkedInAppURL =  URL(string: "linkedin:\(linkedIn)")
                            else { fatalError(Localize.validUrlExpectedMsg) }
 UIApplication.shared.open(linkedInURL, options: [:], completionHandler: nil)
                        }

Always it's redirecting to web only even if the app is installed.

I tried to resolve this issue using deep linking

let linkedIn = "https://www.linkedin.com/in/prakashiyerleadershipcoach"
            guard let linkedInAppURL =  URL(string: "linkedin://profile/prakashiyerleadershipcoach")
            else { fatalError("Invalid linkedInAppURL") }
            guard let linkedInWebURL = URL(string: (linkedIn.removingPercentEncoding)!)
            else { fatalError("Invalid linkedInWebURL") }
            if UIApplication.shared.canOpenURL(linkedInAppURL) {
                UIApplication.shared.open(linkedInAppURL)
                print("linkedinnnnn == \(linkedInAppURL)")
            } else {
                UIApplication.shared.open(linkedInWebURL, options: [:], completionHandler: nil)
                print("linkedinnnnn == \(linkedInWebURL)")
            }
}

Added LSApplicationQueriesSchemes in info.plist file

    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>linkedin</string>
    </array>

Now while clicking on link profile page is opening in app if app is installed otherwise opening in web.
But this is not the official URL schemes provided by linkedIn. I need the permanent solution for that. Can anyone help me in that. Thanks in advance!

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par les appels à UIApplication.shared.open et canOpenURL présentés dans l’issue, puis examinez la prise en charge documentée des URL schemes de l’application liée ainsi que l’entrée LSApplicationQueriesSchemes dans Info.plist. Reproduisez les cas où l’application est installée et désinstallée ; le travail est terminé lorsqu’un scheme documenté et stable est utilisé lorsqu’il est disponible, avec un repli vers l’URL web dans le cas contraire.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
ios, swift
Domaine
mobile-dev
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
30/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.