Closed LegendGin closed 1 month ago
Do you mean that you have an error like mine?
case AppLifecycleState.resumed:
Adjust.onResume();
break;
The member 'onResume' can only be used within 'package:adjust_sdk/adjust.dart' or a test.dart[invalid_use_of_visible_for_testing_member](https://dart.dev/diagnostics/invalid_use_of_visible_for_testing_member)
Hey guys,
Have you upgraded your SDK to v5? If yes, there's no need to make calls to Adjust.onResume()
and Adjust.onPause()
on your own anymore since native Android SDK has now been made to handle those things automatically.
Hey @uerceg,
Thanks for your answer.
Yes, I have just upgrade adjust_sdk
flutter package to v5 and have the following error:
The member 'onResume' can only be used within 'package:adjust_sdk/adjust.dart' or a test.dart[invalid_use_of_visible_for_testing_member](https://dart.dev/diagnostics/invalid_use_of_visible_for_testing_member)
on this code:
class _LifecycleObserverState extends State<LifecycleObserver>
with WidgetsBindingObserver {
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
switch (state) {
case AppLifecycleState.resumed:
Adjust.onResume();
break;
case AppLifecycleState.paused:
Adjust.onPause();
break;
case AppLifecycleState.inactive:
case AppLifecycleState.detached:
case AppLifecycleState.hidden:
break;
}
}
}
I understood that those calls are not needed anymore, aren't it?
Hey @monisnap-jeremie,
Correct, feel free to remove that code snippet entirely from your app and things should work just fine.
Thank you @uerceg 🙏
And as far as @LegendGin's issue is concerned, it might be happening because you were subscribing to LifecycleObserver
and it might have fired a call to Adjust.onResume()
before you have initialized SDK v4. In theory, there's no harm if that happens, SDK is logging this just FYI.
I'll close this ticket, but in case you have any further or follow up questions, feel free to comment/reopen.
Cheers and sorry for a delay in replying.
I launch the flutter sample application, and get "Adjust not initialized, can't perform onResume" warning in logcat, does this warning matter?