Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inactivity, disconnecting from the service push notification #3527

Closed
mouryaavadhesh opened this issue Sep 11, 2020 · 5 comments
Closed

Inactivity, disconnecting from the service push notification #3527

mouryaavadhesh opened this issue Sep 11, 2020 · 5 comments

Comments

@mouryaavadhesh
Copy link

This happens every time when I start the app and go into the background and then when notification received and click on that this happens

W/IInputConnectionWrapper(18909): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(18909): getTextAfterCursor on inactive InputConnection
V/FA (18909): Connecting to remote service
D/FA (18909): Connected to remote service
V/FA (18909): Processing queued up service tasks: 1
V/FA (18909): Recording user engagement, ms: 17536
V/FA (18909): Activity paused, time: 64480659
D/EGL_emulation(18909): eglMakeCurrent: 0xd4b1a4e0: ver 3 1 (tinfo 0xd4b0f7b0)
D/FA (18909): Application going to the background
W/FirebaseMessaging(18909): Missing Default Notification Channel metadata in AndroidManifest. Default value will be used.
D/EGL_emulation(18909): eglCreateContext: 0xac539160: maj 3 min 1 rcv 4
D/EGL_emulation(18909): eglMakeCurrent: 0xac539160: ver 3 1 (tinfo 0xd4be3490)
V/FA (18909): Activity resumed, time: 64486708
D/EGL_emulation(18909): eglMakeCurrent: 0xd4b1a4e0: ver 3 1 (tinfo 0xd4b0f7b0)
D/EGL_emulation(18909): eglMakeCurrent: 0xac539160: ver 3 1 (tinfo 0xd4be3490)
V/FA (18909): Inactivity, disconnecting from the service

@darshankawar
Copy link

Hi @mouryaavadhesh,
Please provide flutter doctor -v and a minimal complete reproducible code sample that shows the issue.
Thanks.

@darshankawar darshankawar added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Sep 11, 2020
@mouryaavadhesh
Copy link
Author

mouryaavadhesh commented Sep 11, 2020

import 'dart:convert';
import 'dart:io';

import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';

import 'package:vahak/colors/theme_color.dart';
import 'package:vahak/company/details.dart';
import 'package:vahak/config/route.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
@OverRide
_MyAppState createState() => _MyAppState();
}

class _MyAppState extends State {
FirebaseMessaging fm = FirebaseMessaging();
GlobalKey navigatorKey = GlobalKey(debugLabel: "Main Navigator");
// This widget is the root of your application.
@OverRide
void initState() {
super.initState();

fm.requestNotificationPermissions(
    const IosNotificationSettings(sound: true, badge: true, alert: true));

fm.configure(
  onMessage: (Map<String, dynamic> message) async {
    // initialise the plugin. app_icon needs to be a added as a drawable resource to the Android head project
  //  displayNotification(message);
   // navigationScreen(message);
    // _showItemDialog(message);
   // navigationScreen(message);

  },
  onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,

  onResume: (Map<String, dynamic> message) async {
   

    navigatorKey.currentState.pushReplacement(MaterialPageRoute(
        builder: (_) => Details(
        )));

  },
  onLaunch: (Map<String, dynamic> message) async {
   
    navigatorKey.currentState.pushReplacement(MaterialPageRoute(
        builder: (_) => Details(
        )));

  },
);
fm.onIosSettingsRegistered.listen((IosNotificationSettings settings) {

});

}

@OverRide
Widget build(BuildContext context) {

return MaterialApp(
  debugShowCheckedModeBanner: false,
  navigatorKey: navigatorKey,
  theme: ThemeData(
    backgroundColor: ThemeColor.text_white_colour,
    // This is the theme of your application.
    //
    // Try running your application with "flutter run". You'll see the
    // application has a blue toolbar. Then, without quitting the app, try
    // changing the primarySwatch below to Colors.green and then invoke
    // "hot reload" (press "r" in the console where you ran "flutter run",
    // or simply save your changes to "hot reload" in a Flutter IDE).
    // Notice that the counter didn't reset back to zero; the application
    // is not restarted.
    primarySwatch: Colors.blue,
    // This makes the visual density adapt to the platform that you run
    // the app on. For desktop platforms, the controls will be smaller and
    // closer together (more dense) than on mobile platforms.

// visualDensity: VisualDensity.adaptivePlatformDensity,
),

  routes: Routes.getRoute(),
  initialRoute: Routes.splashRoute,
);

}

static Future myBackgroundMessageHandler(Map<String, dynamic> message) {
if (message.containsKey('data')) {
// Handle data message
final dynamic data = message['data'];
}

// Or do other work.

}
}

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Sep 11, 2020
@mouryaavadhesh
Copy link
Author

E:\flutter\bin\flutter.bat doctor --verbose
[√] Flutter (Channel beta, 1.19.0-4.1.pre, on Microsoft Windows [Version 10.0.19041.450], locale en-IN)
• Flutter version 1.19.0-4.1.pre at E:\flutter
• Framework revision f994b76974 (3 months ago), 2020-06-09 15:53:13 -0700
• Engine revision 9a28c3bcf4
• Dart version 2.9.0 (build 2.9.0-14.1.beta)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at E:\sdk
• Platform android-R, build-tools 29.0.3
• ANDROID_SDK_ROOT = E:\sdk
• Java binary at: E:\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.0)
• Android Studio at E:\Android Studio
• Flutter plugin version 48.1.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.48.2)
• VS Code at C:\Users\moury\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.13.2

[√] Connected device (2 available)
• Web Server • web-server • web-javascript • Flutter Tools
• Chrome • chrome • web-javascript • Google Chrome 85.0.4183.102

• No issues found!
Process finished with exit code 0

@mouryaavadhesh
Copy link
Author

Hi @mouryaavadhesh,
Please provide flutter doctor -v and a minimal complete reproducible code sample that shows the issue.
Thanks.

Find the detail I have posted above

@darshankawar
Copy link

@mouryaavadhesh,
There's similar open issue describing your case, 88.
Please follow-up there for updates and any questions.
Closing this as duplicate.

@darshankawar darshankawar removed the Needs Attention This issue needs maintainer attention. label Sep 14, 2020
@firebase firebase locked and limited conversation to collaborators Oct 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants