是否可以将url参数(或"查询字符串")传递给谷歌播放并在手机中安装应用程序时跟踪变量?
我已经尝试了链接http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12中的示例,以获取我的iPhone推送通知消息.我可以成功运行除第一次注册推送通知应用程序的步骤之外的所有步骤.
我遵循了不同的代码变体:
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
Run Code Online (Sandbox Code Playgroud)
但没有一个对我有用.我在我的iPhone 4中测试它,我的Xode版本是4.2,操作系统是Lion.请指教.
我想在单击图像时将多个参数传递给函数.这是我的代码
var param1 = 120
var param2 = "hello"
var param3 = "world"
let image: UIImage = UIImage(named: "imageName")!
bgImage = UIImageView(image: image)
let singleTap = UITapGestureRecognizer(target: self, action:#selector(WelcomeViewController.tapDetected(_:secondParam:thirdParam:)))
singleTap.numberOfTapsRequired = 1
bgImage!.userInteractionEnabled = true
bgImage!.addGestureRecognizer(singleTap)
Run Code Online (Sandbox Code Playgroud)
调用功能
func tapDetected(firstParam: Int, secondParam: String, thirdParam: String) {
print("Single Tap on imageview")
print(firstParam) //print 120
print(secondParam) // print hello
print(thirdParam) /print world
}
Run Code Online (Sandbox Code Playgroud)
如何传递参数以便我能获得正确的值?
我正在使用ios 7的MobileCoreServices将应用内容发布到社交媒体上..这是我的代码..
NSArray *activityItems;
NSString *title = _titleLabel.text;
if (_imageLabel.image != nil) {
activityItems = @[title, _imageLabel.image];
} else {
activityItems = @[title];
}
UIActivityViewController *activityController =
[[UIActivityViewController alloc]
initWithActivityItems:activityItems
applicationActivities:nil];
[self presentViewController:activityController
animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
现在它发送普通文本.我希望为Facebook和Twitter发布不同的标题.可能吗?