Closed Goolpe closed 2 years ago
@Goolpe There could be another library in your project that also uses FCM and is initializing it that could be a result of some of these errors. The first screenshot does not seem to be from OneSignal, as OneSignal does not use the Default firebase app. The 2nd screenshot does seem to be from OneSignal as it has the named Firebase app name.
Could you also let us know what you have in your dependencies:
section in your pubspec.yaml
?
On the devices that are having these errors could check the version of the "Google play services" app under Settings > Apps? Could you also make sure those devices can open the Google "Play Store" to ensure it has the latest updates for this.
Could you also attach a full logcat from the device. This way we can see any other errors or warnings before these stack traces.
Unfortunately, can't attach logcat yet, dependencies:
flutter:
sdk: flutter
assorted_layout_widgets: ^5.0.1
connectivity: ^3.0.6
double_back_to_close_app: ^2.0.1
flutter_boom_menu:
git:
url: https://github.com/kuchienkz/flutter_boom_menu
flutter_datetime_picker:
git:
url: https://github.com/Realank/flutter_datetime_picker.git
ref: master
flutter_localizations:
sdk: flutter
flutter_multi_formatter: ^2.3.1
flutter_slidable: ^0.6.0
flutter_spinkit: ^5.0.0
flutter_svg: ^0.22.0
get: ^4.1.4
graphql_flutter: ^5.0.0
hive: ^2.0.4
hive_flutter: ^1.1.0
image_picker: ^0.8.1+3
intl: ^0.17.0
laravel_echo:
git:
url: https://github.com/RizalMuhamadH/echo
material_design_icons_flutter: ^5.0.5955-rc.1
onesignal_flutter: ^3.0.0
pin_code_fields: ^7.2.0
quiver: ^3.0.1
reorderables: ^0.4.1
sentry_flutter: ^5.1.0
socket_io_client: 1.0.1
timeago: ^3.1.0
url_launcher: ^6.0.8
geolocator: ^7.2.0+1
location: ^4.3.0
network_info_plus: ^1.0.2
protoc_plugin: ^20.0.0
wifi_iot: ^0.3.4
UPD: If run app in debug (flutter run) error isn't shown, only in apk logs.txt
@jkasten2, google play services Honor 20 pro:
UPD2: After adding android:allowBackup="false" to AndroidManifest, the error dialog disappeared. But subscription OneSignal.shared.setNotificationWillShowInForegroundHandler still doesnt work
@Goolpe Hello are you still experiencing this issue?
I am no longer working with this project and don’t know if there is an issue, so I close it.
Description:
Implementation of onesignal in release mode (app/build.gradle): some devices show errors (screenshots below: first or second). Debug mode: no dialogs with error, notifications come, but setNotificationWillShowInForegroundHandler doesnt work
Errors: Honor 20 pro, Xiaomi redmi note 9 pro Works fine: Honor 9X, Xiaomi redmi 4x, HUAWEI P smart, Xiaomi redmi note 8 pro
P.S. Absent any firebase dependencies
Environment
onesignal_flutter: ^3.0.0
Steps to Reproduce Issue:
void main() => runApp(const Application());
class Application extends StatefulWidget { const Application({Key? key}) : super(key: key);
@override _ApplicationState createState() => _ApplicationState(); }
class _ApplicationState extends State {
@override void initState() { init(); super.initState(); }
@override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text('Test'), TextButton( onPressed: connect, child: Text('connect') ), TextButton( onPressed: disconnect, child: Text('disconnect') ) ], ), ), ), ); }
Future init() async {
OneSignal.shared.setLogLevel(OSLogLevel.verbose, OSLogLevel.error);
}
void connect(){ OneSignal.shared.setExternalUserId(UserID); }
void disconnect(){ OneSignal.shared.removeExternalUserId(); } }
buildscript { repositories { maven { url 'https://plugins.gradle.org/m2/' } } dependencies { classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.10, 0.99.99]' } }
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin' ..
buildTypes { release { // or this signingConfig signingConfigs.debug signingConfig signingConfigs.release } }