Code=3000 "未找到应用程序的“aps-environment”的授权字符串" 解决办法

本文针对iOS应用中出现的推送失败问题进行了解决。主要原因是由于Xcode中的PushNotification设置未开启,导致授权字符串验证失败。文章提供了具体的操作步骤,并提到了如需进一步排查,还需关注证书、描述文件与项目的bundle identifier一致性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这个问题可能比较多出现,网上呢一股脑的方案是:描述文件,推送证书与项目中的bundle identifer 不一致,或者什么appid不一致呀,什么证书生成顺序不一致呀,什么xcode的code signing没有配置呀,就不写了,网上搜很多,我现在就把自己的问题说一下:

出现的背景是:原先的项目兼容iOS10,远程推送也用了最新的iOS10的推送框架,创建证书、描述文件的时候的appid,顺序啊,bundle identifer呀都正常

如果大家谁也出现这个问题了,不要忘记去看看xcode中的一个设置:
这里写图片描述
就是上图,记得看看打开没打开这个‘Push Notification’开关,打开之后,steps这两步骤会自动检查APP ID等推送文件的合法性。我的项目打开这个开关之后,验证也通过了,再运行,不会出现一开始‘Code=3000 “未找到应用程序的“aps-environment”的授权字符串”’的错误。

如果这两个step报错,就要去按照网上其他的重新设置provisioning profile,bundle identifer等,让其保持一致性。

import os import sys from pathlib import Path root_dir = str(Path(__file__).parent.parent.parent.parent.parent) if root_dir not in sys.path: sys.path.insert(0, root_dir) from model.controllertestcase import ControllerTestCase from OmadaControllerAPI.OpenAPIService.dashboard_service import DashboardService import random import string import time class MyTestCase(ControllerTestCase): def __init__( self, omadacloud_url: str, controller_url: str, username: str, password: str, environment: str, region: str, force_login: bool = False, ): super().__init__( omadacloud_url, controller_url, username, password, environment, region, force_login, ) self.init_case_name_id(os.path.basename(__file__)) self.item_id = "检查/openapi/v1/{omadacId}/sites/{siteId}/dashboard/channels接口" self.expected_result = "Get channel distribution and usage succeed" def setup(self): self.check_test_times() self.get_cookie_and_token_from_config() self.login_by_openapi(type=0) self.dashboard_service = DashboardService( self.openapi_host, self.openapi_headers, self.logger ) def test(self): try: response = self.dashboard_service.get_channel_distribution_and_usage( self.omadacId, 'test-id' ) response_json = response.json() if response_json["errorCode"] == 0: self.case_result = self.result.PASS self.actual_result = "Get channel distribution and usage succeed" self.logger.info(self.actual_result) else: self.case_result = self.result.FAIL self.actual_result = ( f"Get channel distribution and usage failed: {response_json['msg']}" ) self.logger.error(self.actual_result) except Exception as e: self.case_result = self.result.FAIL self.actual_result = f"Get channel distribution and usage failed: {e}" self.logger.error(self.actual_result) self.add_result( self.case_result, self.item_id, self.actual_result, self.expected_result, "", ) def teardown(self): pass if __name__ == "__main__": testcase = MyTestCase( "", "https://localhost:8043/82064d2c4dff19907fd0fe09bf88ef8d", "admin", "Tplink123!", "prd", "aps1", True, ) testcase.do_test()
最新发布
08-15
评论 15
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值