[英]React-native UI not rendering properly when clicked on push notifications in IOS 15
我在我的反應原生應用程序中集成了推送通知。 當我單擊推送通知(已刪除應用程序實例)時,我的應用程序打開並導航到主屏幕,但 UI 未呈現(樣式未應用於 UI)。 它只發生在 IOS 中。 Android 工作正常
我的版本
"@aws-amplify/pushnotification": "^3.2.32"
"aws-amplify": "4.3.7"
"aws-amplify-react-native": "6.0.1"
"@react-native-community/push-notification-ios": "1.9.0"
"react": "16.13.1"
"react-native": "0.63.4"
我在鈎子 class 之外使用 PushNotification.onNotificationOpened。
Styles 從外部樣式表加載
示例代碼
`import PushNotification from '@aws-amplify/pushnotification'`
PushNotification.onNotificationOpened(notification => {
let obj = notification["_data"]["data"]["jsonBody"]
setTimeout(()=>{
notificationAPI(obj.id)
},1000)
});
const Home = ({route, navigation}) =>{
useEffect(() => {
APICall()
})
}, [isVisible]);
return (
<View>
**CUSTOME UI**
</View>
)
}
export default Home;
當我單擊推送通知 UI 應在應用了所有 styles 的情況下正確呈現時,如何解決此問題。
原始用戶界面
當我單擊推送通知應用程序打開時,styles 不適用。
我更新了我的 XCODE 和 macOS,再次存檔,這個版本現在看起來很好。 xcode 版本:13.1 macOS 版本:12.0.1
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.