的功能“AudioServicesPlaySystemSoundWithVibration”隐式声明是在C99

问题描述:

无效我需要500毫秒秒振动,我使用下面的代码的功能“AudioServicesPlaySystemSoundWithVibration”隐式声明是在C99

NSMutableDictionary* dict = [NSMutableDictionary dictionary]; 
NSMutableArray* arr = [NSMutableArray array ]; 

[arr addObject:[NSNumber numberWithBool:YES]]; //stop for 500ms 
[arr addObject:[NSNumber numberWithInt:500]]; 

[dict setObject:arr forKey:@"VibePattern"]; 
[dict setObject:[NSNumber numberWithInt:1] forKey:@"Intensity"]; 


AudioServicesPlaySystemSoundWithVibration(4095,nil,dict); 

AudioServicesPlaySystemSoundWithVibration完美的工作,但给的警告以及我不能够释放我的应用程序到应用商店。

我的AMD包括AudioTools框架在我的项目

请帮我

在此先感谢

+0

这是一个私有的API方法,你不能使用它。看看http://*.com/questions/4724980/making-the-iphone-vibrate而不是 – luk2302 2015-03-31 11:34:14

+0

谢谢** luk2302 **'AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);''AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);'这2功能振动手机但我需要500毫秒的振动,这种方法给我超过500毫秒。我只需要捏一下振动。 – Bhavsar1311 2015-04-01 13:36:43

+0

我认为隐藏私有c API是不可能的。 – kelin 2016-12-26 11:04:15

尝试使用FOUNDATION_EXTERN宏声明函数:

FOUNDATION_EXTERN AudioServicesPlaySystemSoundWithVibration(unsigned long, objc_object*, NSDictionary*) 

但准备因私人API使用而被拒绝,特别是在美国App Store上。