我在我的 iOS 和 Android 项目中使用 Worklight。 我还使用适配器,进行安全测试,并使用基于适配器的身份验证。
我想使用推送通知,以及从基于适配器的身份验证功能收到的用户 ID。所以我使用相同的securityTest。
现在,当我尝试将安全测试与推送事件源结合使用时,出现错误“无法从数据库部署适配器”
WL.Server.createEventSource({
name : 'MyPushEventSource',
onDeviceSubscribe : 'deviceSubscribeFunc',
onDeviceUnsubscribe : 'deviceUnsubscribeFunc',
securityTest : 'MySecurityTest',
});
当我删除最后一行(securityTest)时,适配器被部署,当我添加它时,它失败。
此 securityTest 已与多个其他适配器功能一起使用。
谁能帮我解释一下这是怎么回事? 提前致谢。
编辑:这是我的安全测试定义:
<securityTests>
<customSecurityTest name="MySecurityTest">
<test isInternalUserID="true" realm="MyAuthRealm"/>
</customSecurityTest>
</securityTests>
最佳答案
最后,对我有用的解决方案是添加一个新的安全测试,具有相同的领域,并且类型为 mobileSecurityTest
<mobileSecurityTest name="MyPushSecurityTest">
<testUser realm="MyAuthRealm"/>
<testDeviceId provisioningType="none"/>
</mobileSecurityTest>
我认为这应该添加到当前的 Worklight 文档中,或者必须打开错误报告。
感谢大家的帮助。
关于push-notification - Worklight 推送通知和 SecurityTest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15407731/