Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/120.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 振动并发出声音以发出本地通知_Objective C_Ios_Notifications - Fatal编程技术网

Objective c 振动并发出声音以发出本地通知

Objective c 振动并发出声音以发出本地通知,objective-c,ios,notifications,Objective C,Ios,Notifications,如何向LocalNotiAction添加振动和声音 代码: 您可以设置声音: notification.soundName = @"yourSound.aiff" ; // see also UILocalNotificationDefaultSoundName 但振动超出了您的控制范围: 不幸的是,如果您想要声音,您不能禁用振动,除非用户进入常规设置并自行禁用振动。 UILocalNotification API允许您设置系统默认声音、选择声音或无声音,如果有声音,它将在正确的情况下振

如何向LocalNotiAction添加振动和声音

代码:

您可以设置声音:

notification.soundName = @"yourSound.aiff" ;   // see also UILocalNotificationDefaultSoundName
但振动超出了您的控制范围:

不幸的是,如果您想要声音,您不能禁用振动,除非用户进入常规设置并自行禁用振动。

UILocalNotification API允许您设置系统默认声音、选择声音或无声音,如果有声音,它将在正确的情况下振动,即用户已启用振动。但除此之外,你们无法控制振动是否发生或持续多久。

您可以设置声音:

notification.soundName = @"yourSound.aiff" ;   // see also UILocalNotificationDefaultSoundName
但振动超出了您的控制范围:

不幸的是,如果您想要声音,您不能禁用振动,除非用户进入常规设置并自行禁用振动。

UILocalNotification API允许您设置系统默认声音、选择声音或无声音,如果有声音,它将在正确的情况下振动,即用户已启用振动。但除此之外,你们无法控制振动是否发生或持续多久。