![](/img/trans.png)
[英]Swift didReceiveRemoteNotification userInfo can't get value
[英]I can't get shortcutItem. The value of the userInfo
3DTouch
這個清單
<dict>
<key>UIApplicationShortcutItemIconType</key>
<string>UIApplicationShortcutIconTypeShare</string>
<key>UIApplicationShortcutItemTitle</key>
<string>share</string>
<key>UIApplicationShortcutItemType</key>
<string>UITouchText.share</string>
<key>UIApplicationShortcutItemUserInfo</key>
<dict/>
<key>url</key>
<string>value1</string>
</dict>
和在
-(void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler
我想獲取shortcutItem.userInfo
if([shortcutItem.type isEqualToString:@"UITouchText.share"])
{
NSLog(@"%@",shortcutItem.userInfo[@"url"]);
}
但是字典返回空
抱歉,此列表是錯誤的。
<dict>
<key>UIApplicationShortcutItemIconType</key>
<string>UIApplicationShortcutIconTypeShare</string>
<key>UIApplicationShortcutItemTitle</key>
<string>share</string>
<key>UIApplicationShortcutItemType</key>
<string>UITouchText.share</string>
<key>UIApplicationShortcutItemUserInfo</key>
<dict>
<key>url</key>
<string>value1</string>
</dict>
</dict>
作為屬性列表打開
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.