我在Flutter应用程序中介绍了OneSignal,但在Flutter中不起作用! 我无法建立iPhone ...
我想创建一个推送通知功能。 我查看了正式文件,照原样完成了。
参考:
我的代码:
void main() async {
FirebaseAnalytics analytics = FirebaseAnalytics();
FirebaseAnalyticsObserver observer = FirebaseAnalyticsObserver(analytics: analytics);
void _handleNotificationReceived(OSNotification notification) {
}
OneSignal.shared.setNotificationReceivedHandler(_handleNotificationReceived);
OneSignal.shared.init(
"ID",
iOSSettings:
{
OSiOSSettings.autoPrompt: false,
OSiOSSettings.inAppLaunchUrl: true
}
);
OneSignal.shared.setInFocusDisplayType(OSNotificationDisplayType.notification);
OneSignal.shared.setNotificationReceivedHandler((OSNotification notification) {
});
OneSignal.shared.setNotificationOpenedHandler((OSNotificationOpenedResult result) {
});
OneSignal.shared.setPermissionObserver((OSPermissionStateChanges changes) {
});
OneSignal.shared.setSubscriptionObserver((OSSubscriptionStateChanges changes) {
});
OneSignal.shared.setEmailSubscriptionObserver((OSEmailSubscriptionStateChanges emailChanges) {
registered
});
Android设备成功收到通知,
但是...
错误代码:
Error output from Xcode build:
↳
2019-08-02 20:09:54.715 xcodebuild[63419:2094699] DTDeviceKit: deviceType from deviceID was NULL
2019-08-02 20:09:54.758 xcodebuild[63419:2094694] DTDeviceKit: deviceType from deviceID was NULL
** BUILD FAILED **
Xcode's output:
↳
ld: warning: directory not found for option '-L/../build/ios/Debug-iphoneos/FirebaseAuth'
ld: warning: directory not found for option
'-L/../build/ios/Debug-iphoneos/firebase_analytics'
ld: warning: directory not found for option
'-L/../build/ios/Debug-iphoneos/firebase_auth'
ld: warning: directory not found for option
'-L/../build/ios/Debug-iphoneos/firebase_core'
ld: library not found for -lFirebaseAuth
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Could not build the precompiled application for the device.
你能帮我吗?