首页 \ 问答 \ 当用户切换静音开关时,静音(Mute Sound When User Toggles Mute switch On)

当用户切换静音开关时,静音(Mute Sound When User Toggles Mute switch On)

最近我开始为我的项目添加音频,当你点击一个按钮它会产生一个很好的声音效果,但即使我的iPhone的静音开关打开,声音仍然播放。 我想知道如何检测用户已在静音开关上切换,如果这样,则完全静音应用程序的声音。


Recently i have started adding audio to my project, when you tap a button it will make a nice sound effect but even if my iPhone's mute switch is on the sound still plays . I would like to know how to detect the user has toggled on the mute switch and if so mute the sounds of the app completely.


原文:https://stackoverflow.com/questions/40968309
更新时间:2022-09-23 08:09

最满意答案

是你要做的请求:

/v3/surveys?api_key=<key>&fields=per_page

并期望返回的字段只是per_page(没有数据,或其他任何东西)?

我认为这不起作用,我认为fields url参数仅适用于特定资源,而不适用于资源列表。

因此,如果您想过滤掉特定的调查,这将有效:

/v3/surveys/<survey_id>?api_key=<key>&fields=title

但不是资源列表,它总是返回可用项目的总数,您当前所在的页面,每页有多少项目,分页链接以及data下的所有资源项目。

编辑:解释如何获得调查回复

获取调查回复的文档在这里 。 根据您的评论,您想要做的是:

GET /v3/surveys/<id>/responses?api_key=<key>&email=<email>&start_created_at=<begin_range>&end_created_at=<end_range>

这将通过提供的电子邮件以及由和指定的日期范围内的所有响应(通过ID)获取。

然后,您可以在此处获取该响应的所有详细信息(每个页面的每个答案):

GET /v3/surveys/<id>/responses/<response_id>?api_key=<key>

鉴于您正在使用电子邮件收集器(这就是您收到电子邮件的方式),并且在该调查的列表中确实应该只返回一个响应ID,除非他们不止一次地回答了调查。 如果是这样的话你就可以做到

GET /v3/surveys/<id>/responses/bulk?api_key=<key>&email=<email>&start_created_at=<begin_range>&end_created_at=<end_range>

只有一个请求,您可以在一个请求中获得所有响应,包括给定电子邮件的答案。


Is the request you're trying to do:

/v3/surveys?api_key=<key>&fields=per_page

And expecting the fields returned to only be per_page (no data, or anything else)?

I don't think that'll work, I think the fields url parameter only works for a specific resource, not a resource list.

So if you wanted to filter out a specific survey, this would work:

/v3/surveys/<survey_id>?api_key=<key>&fields=title

But not for a resource list, it'll always return the total amount of items available, which page you're currently on, how many items per page, the links for pagination, and all the resource items under data.

EDIT: Explaining how to get survey responses

The docs for fetching survey responses are here. What you'd want to do based on your comment is:

GET /v3/surveys/<id>/responses?api_key=<key>&email=<email>&start_created_at=<begin_range>&end_created_at=<end_range>

This will get you all the responses (by ID) for a respondent with the provided email, and within the date range specified by and .

You can then fetch all the details of that response (every answer for every page) here:

GET /v3/surveys/<id>/responses/<response_id>?api_key=<key>

Given that you are using an email collector (that's how you have their email) and there should really only be one response ID returned in the list for that survey, unless they answered the survey more than once. If that's the case then you can do

GET /v3/surveys/<id>/responses/bulk?api_key=<key>&email=<email>&start_created_at=<begin_range>&end_created_at=<end_range>

Only, which with one request you can get all the responses including the answers for that given email in one request.

相关问答

更多
  • excel怎么使用VBA[2022-04-29]

    excel使用VBA主要是通过宏运行的模式 一般要求来说 如果你没有VBA知识 建议用excel公式 VBA的代码在excel开发工具界面 可以在常规选项中 开发工具可见处打勾 就可以看到visual basic 和 宏两个选项 进去就能输入代码
  • 是的,这是可能的。 听起来你想创建一个私人应用程序( https://developer.surveymonkey.com/build-a-private-app/ )。 关于UserId跟踪,如果您使用的是Web链接收集器,请使用调查自定义变量;如果您使用的是电子邮件收集器,请使用收件人自定义字段。 Yes, this is possible. Sounds like you want to create a private app (https://developer.surveymonkey.com/ ...
  • SurveyMonkey确实有一个REST API 您可以获得所有响应(只是ID): GET /surveys/{survey_id}/responses 请参阅: https : //developer.surveymonkey.com/api/v3/#surveys-id-responses 您可以通过ID获取特定响应的问题的详细信息和所有答案: GET /responses/{response_id}/details 请参阅: https : //developer.surveymonkey.co ...
  • 这不是最漂亮的解决方案,但我注意到可以从帮助中心获得的快速方法是取消受访者的资格 。 这是因为您可以设置自定义URL以在用户取消资格后将其发送给我们,否则我不知道。 您可以使用高级分支逻辑来指定何时取消对受访者的资格(例如,在回答最后一个问题时)。 您还可以通过API使用webhooks来获取有关受访者完成情况的通知,并且您可以使用它来对您的结束进行更改(例如升级他们的计划)。 这是一个建议,如果这对您不起作用,您可能需要调查帮助中心 。 It's not the prettiest solution, b ...
  • 在这里查看SurveyMonkey API文档。 要创建提醒消息,您可以执行以下操作: POST /collectors//messages { "type": "reminder", "recipient_status": "has_not_responded", "subject": "Reminder! We want your opinion" } 这将为所有尚未响应的收件人创建一条新消息(还有其他选项,以及您可以修改电子邮件的正文,请参阅文档 ...
  • 这是修复它的分支https://github.com/GeorgePhillips/node-surveymonkey Here is the fork that has it fixed https://github.com/GeorgePhillips/node-surveymonkey
  • 'get_responses'中的响应实际上只是用户输入的答案。 您想要的元数据实际上保存在响应者详细信息中,可通过get_respondent_list访问。 有一个date_start就是他们开始响应的时候,而date_modified是他们最后一次改变它的时候(当他们完成时就是他们完成它的时候)。 The response in 'get_responses' is literally just the answers the user inputted. The metadata you want ...
  • 是你要做的请求: /v3/surveys?api_key=&fields=per_page 并期望返回的字段只是per_page(没有数据,或其他任何东西)? 我认为这不起作用,我认为fields url参数仅适用于特定资源,而不适用于资源列表。 因此,如果您想过滤掉特定的调查,这将有效: /v3/surveys/?api_key=&fields=title 但不是资源列表,它总是返回可用项目的总数,您当前所在的页面,每页有多少项目,分页链接以及data下的所有 ...
  • 您需要在标头中设置访问令牌。 我刚检查了文档中的示例,但是缺少了。 文档应该是固定的。 OAuth示例就在这里 。 因此,特别是对于该请求,您需要执行以下操作: headers = { 'Content-Type': 'application/json', 'Authorization': 'bearer ACCESS_TOKEN_HERE' } s.get(url, headers=headers) 这对你有用。 You need to set the access token in ...
  • 通过“更新结果”,我认为您的意思是要为您的调查创建新的响应。 您可以使用响应API执行此操作 。 页面右侧有cURL示例。 有点像: curl -i -X POST https://api.surveymonkey.net/v3/collectors/{collector_id}/responses \ -H "Content-Type: application/json" -H "Authorization:bearer " \ -d '{ ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。