我需要500ms的震动,为此我正在使用以下代码:
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正常工作,但同时会出现警告,我无法将应用程序发布到应用商店。
我在项目中包含了AudioTools框架。
请帮助我。
先行致谢。
AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
这两个函数可以使手机震动,但我需要500ms的震动,而这种方法给我的震动时间超过了500ms。我只需要一点点的震动。 - Bhavsar1311