小编Mik*_*sya的帖子

本地通知不适用于某些用户(iOS 8)

我有一个使用本地通知的应用程序,并且在以前的版本中使用了ti.我已经更新了iOS 8的应用程序并进行了测试并且运行良好.在向app store提交更新后,少数用户抱怨他们没有收到任何本地通知.但是,我检查过的用户数量较多,没有任何问题.

对于有错误的用户(至少其中一个),他们无法在"设置 - > myApp"屏幕中看到"通知"项目; 缺少整个选项而不是禁用它."位置"和"使用蜂窝数据"在该屏幕中,但不在通知中.我试图更改"设置 - >通知 - > myApp"下的设置,它按预期工作.

有关如何调试此问题的任何建议都将非常有用.谢谢!

notifications ios ios8

9
推荐指数
1
解决办法
2598
查看次数

在 iOS 13 中播放系统声音

我曾经能够使用下面的代码播放系统音频文件。这在 iOS 13 中对于新旧应用程序均不起作用。

import AudioToolbox
import AVFoundation

...

    func tock() {
        do {
            try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category(rawValue: convertFromAVAudioSessionCategory(AVAudioSession.Category.ambient)))

            var myAlertSound: SystemSoundID = 0
            let url: URL = URL(string: "/System/Library/Audio/UISounds/Tock.caf")!
            AudioServicesCreateSystemSoundID( (url) as CFURL, &myAlertSound)
            AudioServicesPlaySystemSound(myAlertSound)
        } catch {
            print("Error in audio feedback")
        }
    }

    // Helper function inserted by Swift 4.2 migrator.
    private func convertFromAVAudioSessionCategory(_ input: AVAudioSession.Category) -> String {
        return input.rawValue
    }
Run Code Online (Sandbox Code Playgroud)

我也没有看到“音频反馈错误”打印。

有没有办法在 iOS 13 中播放简单的声音?

avfoundation ios swift ios13

2
推荐指数
1
解决办法
4104
查看次数

标签 统计

ios ×2

avfoundation ×1

ios13 ×1

ios8 ×1

notifications ×1

swift ×1