小编mkw*_*won的帖子

iOS 7中的静默推送通知不起作用

在WWDC 2013的"多任务新功能"演示中,有一个关于静音推送通知的部分.看起来很简单.根据演示文稿,如果您将APS有效负载仅发送到内容可用设置为1,则不会通知用户该通知.

// A. This doesn't work
{ 
  aps: { 
          content-available: 1 
       }
}
Run Code Online (Sandbox Code Playgroud)

我的测试显示,这不起作用,因为没有收到推送.但是,如果我包含声音属性但排除了alert属性,它就会起作用(虽然不再是静音).

// B. This works
{ 
  aps: {
          content-available: 1,
          sound: "default"
       }
}
Run Code Online (Sandbox Code Playgroud)

但是,如果我更改声音属性以播放静音,我可以模仿静音.

// C. This works too.
{ 
  aps: {
          content-available: 1,
          sound: "silence.wav"
       }
}
Run Code Online (Sandbox Code Playgroud)

有人知道吗:

  1. 如果这是一个bug?
  2. 如果假设B或C被视为远程通知是正确的(而不是Silent Push需要声音属性的错误)?如果是这样,这意味着它没有像Silent Pushes那样的速率限制...... Apple可能会解决这个问题.所以我可能不应该依赖它.
  3. 速率限制是什么(N每推X秒等)?

提前致谢.

编辑更多信息

对于A,应用程序的状态无关紧要.从未收到通知.

看起来B和C只有在将属性和值括在引号中时才有效,如下所示.

{"aps":{"content-available": 1, "sound":"silent.wav"}}
Run Code Online (Sandbox Code Playgroud)

并且通知到达应用程序:didReceiveRemoteNotification:fetchCompletionHandler:无论状态如何.

push-notification ios ios7

86
推荐指数
4
解决办法
6万
查看次数

AudioUnit:mediaserverd报告的错误 - "错误"是什么'获取物理格式的客户端格式"

我有一个使用AudioUnit的VOIP应用程序.在iOS 9上,我看到一条错误消息,说明如下.我在iOS 8中没有看到这个:

mediaserverd [43]:13:16:38.880错误:[0x1f72d000]> va> 500:错误'什么'获取物理格式的客户端格式[16/44100/2; flags:0xc; bytes/packet:4; 帧/包:1; bytes/frame:4; ]

有谁知道这意味着什么?音频似乎工作正常,但我仍然有点厌烦,如果可以,我想解决它.我的AudioUnit设置代码如下.帮助赞赏.谢谢.

CheckError(NewAUGraph(&audioState.graph), "NewAUGraph failed");

AUNode rioNode;    
AudioComponentDescription desc;

desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_VoiceProcessingIO;
desc.componentFlags = 0;        // Documentation states "Set this value to zero"
desc.componentFlagsMask = 0;    // Documentation states "Set this value to zero"
desc.componentManufacturer = kAudioUnitManufacturer_Apple;

CheckError(AUGraphAddNode(audioState.graph, &desc, &rioNode), "AUGraphAddNode failed for RIO");
CheckError(AUGraphOpen(audioState.graph),"Failed to open graph");
CheckError(AUGraphNodeInfo(audioState.graph, rioNode, NULL, &audioState.rio),"Failed to get rio node info");

UInt32 flag = 1;
CheckError(AudioUnitSetProperty(audioState.rio,
                                kAudioOutputUnitProperty_EnableIO,
                                kAudioUnitScope_Input,
                                1,
                                &flag, …
Run Code Online (Sandbox Code Playgroud)

audiounit ios ios9

17
推荐指数
0
解决办法
700
查看次数

iOS 7,用于断开调用的私有API CTCallDisconnect不起作用

我一直在使用私有API(不在App Store上供个人使用)来阻止传入呼叫使用此Stackoverflow帖子中列出的步骤如何使用私有API来阻止iOS应用程序中的传入呼叫?

我最近升级到iOS 7,发现它不再起作用了.收到来电时,我仍然收到"kCTCallIdentificationChangeNotification"通知,但是当我调用CTCallDisconnect函数时,它什么也没做.

当我在CoreTelephony库上执行"nm"命令时,它仍会列出CTCallDisconnect函数,因此它看起来仍然存在于iOS 7中.

在iOS 7中拒绝接听来电有没有运气?

谢谢!

api private iphone-privateapi ios ios7

7
推荐指数
1
解决办法
2394
查看次数

崩溃“无效的参数不满足:bundleProxy!= nil” [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions ..]

我无法重现此错误,但是我的一位用户因以下错误而崩溃(在iOS 11上)。

Fatal Exception: NSInternalInconsistencyException
Invalid parameter not satisfying: bundleProxy != nil
Run Code Online (Sandbox Code Playgroud)

调用以下代码段时:

[[UNUserNotificationCenter currentNotificationCenter]
  requestAuthorizationWithOptions:
    (UNAuthorizationOptionAlert | 
     UNAuthorizationOptionBadge |
     UNAuthorizationOptionSound)
  completionHandler:
    ^(BOOL granted, NSError * _Nullable error) {
      if (granted) {
        [self getNotificationSettings];
      }
}];
Run Code Online (Sandbox Code Playgroud)

我无法自己复制它。而且我在这里或网上找不到任何类似的东西。有没有其他人碰到这个可以阐明一些观点的人?

iphone push-notification ios ios11

6
推荐指数
0
解决办法
1777
查看次数