2016-07-06 131 views
0

我試圖用一個LinkedIn應用程序爲應用程序的多個版本的白色標籤。iOS的多個應用程序共享一個LinkedIn應用

我已經成功地得到了FB這樣做 - 而且似乎LinkedIn應該是非常相似的,但不能順利拿到LinkedIn返回到正確的應用程式(安裝別人的時候)。有時它不會返回,有時它會轉到另一個共享同一個LI App ID的應用程序...

我已將bundleIDs com.bethegame.app1和com.bethegame.app2添加到LinkedIn Mobile App,並將app1和app2添加爲LinkedIn iOS移動應用的後綴。

下面是在我的plist爲每個應用程序...

 <key>CFBundleTypeRole</key> 
     <string>Editor</string> 
     <key>CFBundleURLName</key> 
     <string>com.bethegame.app1</string> 
     <key>CFBundleURLSchemes</key> 
     <array> 
      <string>app1</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleURLSchemes</key> 
     <array> 
      <string>fb123456789</string> 
     </array> 
     <key>FacebookUrlSchemeSuffix</key> 
     <string>app1</string> 
    </dict> 
    <dict> 
     <key>CFBundleTypeRole</key> 
     <string>Editor</string> 
     <key>CFBundleURLName</key> 
     <string>com.bethegame.app1</string> 
     <key>CFBundleURLSchemes</key> 
     <array> 
      <string>li1234567-app1</string> 
     </array> 
     <key>LISuffix</key> 
     <string>app1</string> 
    </dict> 

就像我說的FB的作品雖然「FacebookUrlSchemeSuffix」被記錄在案,LinkedIn的「LISuffix」是不是?

+0

所有這些應用程序具有相同的URL方案? – Lumialxk

+0

對不起,我不清楚你在問什麼?每個應用程序都將是獨一無二的urlscheme方面 - 見上面,每個不同的應用程序將有APP1,APP2,APP3等等......作爲參考的後綴。 –

回答

0

爲了支持多個iOS應用程序共享一個LinkedIn應用程序,去你的LinkedIn開發者帳戶,發現自己的應用並轉到移動設置部分。在iOS設置部分下添加必要的iOS軟件包標識符和iOS URL Scheme後綴。記下該屏幕上顯示的應用程序ID。

在您的Xcode,打開你的項目的Info.plist文件,並添加以下內容:與應用程序ID

<dict> 
    <key>CFBundleURLName</key> 
    <string>li{LinkedInAppId}</string> 
    <key>CFBundleURLSchemes</key> 
    <array> 
     <string>li{LinkedInAppId}-{suffix}</string> 
    </array> 
</dict> 

更換{} LinkedInAppId:

<key>LIAppId</key> 
<string>{LinkedInAppId}</string> 
<key>LISuffix</key> 
<string>{suffix}</string> 

而下面進入CFBundleURLTypes你只需記下下來,並用開發人員網站上添加的{suffix}來代替{suffix}。

+0

這個工程!謝謝 –

相關問題