Local Push Notification II - Flutter

Поделиться
HTML-код
  • Опубликовано: 1 окт 2024
  • Click here to Subscribe to Johannes Milke: www.youtube.co...
    ► Source code: github.com/Joh...
    ► Buy My Courses: johannesmilke....
    ► Follow Twitter: in...
    Last video: • Local Push Notificatio...
    Share this video, write a comment and hit the like button. To never miss anything, subscribe to my RUclips channel (Activate the bell, to never miss upcoming
    Flutter videos): bit.ly/Johannes...
    #JohannesMilke
    ► Overview of all my Flutter projects: bit.ly/Johannes...
    FOLLOW & VISIT ME on my social media:
    Twitter: / johannesmilke
    Facebook: / johannes.milke.37
    Instagram: / johannesmilke
    ► Top Flutter Playlists #JohannesMilke: bit.ly/FlutterP...
    ******************
    ► Subscribe JohannesMilke on RUclips
    bit.ly/Johannes...
    *********************
    ► Watch more Flutter videos #JohannesMilke: bit.ly/FlutterV...
    If you find this video useful, LIKE & SHARE this video to help other people who also learn Flutter :)
    #Flutter #FlutterTutorials #FlutterDev #JohannesMilke
    Copyright song "Corporate Technology" by scottholmesmusic.com

Комментарии • 37

  • @pancaadnanandrian9471
    @pancaadnanandrian9471 5 лет назад +3

    Why at utils i have problem with( imageInfo,_) asycn {

    • @ellee8615
      @ellee8615 4 года назад +2

      - Try This ^^
      import 'dart:async';
      import 'dart:io';
      import 'dart:ui';
      import 'package:flutter/material.dart';
      import 'package:path_provider/path_provider.dart';
      Future saveImage(BuildContext context, Image image) {
      final completer = Completer();
      image.image.resolve(ImageConfiguration()).addListener(
      ImageStreamListener((ImageInfo image, bool synchronousCall) async {
      final byteData = await image.image.toByteData(format: ImageByteFormat.png);
      final pngBytes = byteData.buffer.asUint8List();
      final fileName = pngBytes.hashCode;
      final directory = await getApplicationDocumentsDirectory();
      final filePath = '${directory.path}/$fileName';
      final file = File(filePath);
      await file.writeAsBytes(pngBytes);
      completer.complete(filePath);
      }));
      return completer.future;
      }

    • @josedanielgrijalbaosorio7431
      @josedanielgrijalbaosorio7431 4 года назад

      @@ellee8615 thank you, I had the same problem

  • @siddheshtamhanekar3144
    @siddheshtamhanekar3144 4 года назад +1

    Hi Johannes your tutorials are really good. I want to ask you one question we are storing the images in application directory. How and when we should delete them? as they will consume space.

  • @RustuYucel
    @RustuYucel 4 года назад +2

    Great Tutorial! Thanks. How scheduled (ie.. at certain time of the day and weekdays) push notification can be made? Looking fwd for a tutorial

  • @DinhThucNguyen
    @DinhThucNguyen 4 года назад +1

    Hi Milke, seem that there are many errors with new version? Like:
    Could you help to fix that ?
    error: Undefined name 'BitmapSource'. (undefined_identifier at [meoi] lib\local_notications_helper.dart:51)
    error: The named parameter 'style' isn't defined. (undefined_named_parameter at [meoi] lib\local_notications_helper.dart:58)
    error: The argument type 'String' can't be assigned to the parameter type 'AndroidBitmap'. (argument_type_not_assignable at [meoi] lib\local_notications_helper.dart:82)
    error: The named parameter 'largeIconBitmapSource' isn't defined. (undefined_named_parameter at [meoi] lib\local_notications_helper.dart:83)
    error: Undefined name 'BitmapSource'. (undefined_identifier at [meoi] lib\local_notications_helper.dart:83)

    • @m.s.8939
      @m.s.8939 4 года назад

      @Nguyen Dinh Thun @Johannes Milke
      i have the same issue, please how do you fix that ?

    • @DinhThucNguyen
      @DinhThucNguyen 4 года назад

      @@m.s.8939 please check the asset image

    • @m.s.8939
      @m.s.8939 4 года назад

      @@DinhThucNguyen yes i check it and it's valid..

  • @clipreels4953
    @clipreels4953 2 года назад

    image.resolve(ImageConfiguration()).addListener((imageInfo, _) async { not working

  • @sergioernestotostadosanche2509
    @sergioernestotostadosanche2509 3 года назад

    Hello again! thank you for the video :D, I think IMHO this package has a update so I can't load pictures unless I saved at drawable Android folder and I can load them through DrawableResourceBitmap instead of FilePathAndroidBitmap, when I try loading icon & largeIcon by filePath also these parameters were changed to xAndroidBitmap) the stacktrace says file not found. I'm glad with your videos, regards!

  • @honkevin1212
    @honkevin1212 5 лет назад +1

    Thanks for the video!!!!! Can you also demonstrate how to use the Scheduled notification function?

  • @woshitomtom
    @woshitomtom 5 лет назад +2

    Thanks for the tutorial! What would be the best way to trigger a Local Notification from an API? Mixing Cloud Notifications and Local Notifications? If so it would be really awesome to have this kind of tutorial.

    • @fabioburkard
      @fabioburkard 5 лет назад

      Genius! A background fcm that triggers a local notification with images! I'll try it :)

    • @woshitomtom
      @woshitomtom 5 лет назад

      @@fabioburkard I tried, but couldn't trigger the local notification with fcm when the app is closed. Please update me if you succeed :)

    • @fabioburkard
      @fabioburkard 5 лет назад

      ​@@woshitomtom Same here... there's a long (and old) discussion here: github.com/firebase/quickstart-android/issues/41
      Maybe using a channel and registering directly, but will probably fail (see Muhammad Babar's answer here: stackoverflow.com/questions/37711082/how-to-handle-notification-when-app-in-background-in-firebase/42279260#42279260 )
      I'll try channels when I buy some time, so if it work I'll create a github project - but, honestly, seems impossible so far.
      (Y)

  • @themindstorm9947
    @themindstorm9947 5 лет назад +1

    Thanks for the tutorial! Just wanted to ask, do you have any tutorials on app architecture?

  • @ellee8615
    @ellee8615 4 года назад +1

    [solved ]
    Thanks for the video but :
    I get this in utils. dart
    error: The argument type 'Future Function(dynamic, dynamic)' can't be assigned to the parameter type 'ImageStreamListener'. (argument_type_not_assignable at [projectname33] lib/utils.dart:11)
    - Try This :)
    import 'dart:async';
    import 'dart:io';
    import 'dart:ui';
    import 'package:flutter/material.dart';
    import 'package:path_provider/path_provider.dart';
    Future saveImage(BuildContext context, Image image) {
    final completer = Completer();
    image.image.resolve(ImageConfiguration()).addListener(
    ImageStreamListener((ImageInfo image, bool synchronousCall) async {
    final byteData = await image.image.toByteData(format: ImageByteFormat.png);
    final pngBytes = byteData.buffer.asUint8List();
    final fileName = pngBytes.hashCode;
    final directory = await getApplicationDocumentsDirectory();
    final filePath = '${directory.path}/$fileName';
    final file = File(filePath);
    await file.writeAsBytes(pngBytes);
    completer.complete(filePath);
    }));
    return completer.future;
    }

    • @ellee8615
      @ellee8615 4 года назад

      - Try This ^^
      import 'dart:async';
      import 'dart:io';
      import 'dart:ui';
      import 'package:flutter/material.dart';
      import 'package:path_provider/path_provider.dart';
      Future saveImage(BuildContext context, Image image) {
      final completer = Completer();
      image.image.resolve(ImageConfiguration()).addListener(
      ImageStreamListener((ImageInfo image, bool synchronousCall) async {
      final byteData = await image.image.toByteData(format: ImageByteFormat.png);
      final pngBytes = byteData.buffer.asUint8List();
      final fileName = pngBytes.hashCode;
      final directory = await getApplicationDocumentsDirectory();
      final filePath = '${directory.path}/$fileName';
      final file = File(filePath);
      await file.writeAsBytes(pngBytes);
      completer.complete(filePath);
      }));
      return completer.future;
      }

  • @erperejildo
    @erperejildo 4 года назад

    How can we send this directly from Firebase? I saw you other videos but didn't find how to send images, only text from Firebase

  • @SteissTheMan
    @SteissTheMan 5 лет назад

    Awesome videos, Johannes! Really a great source of learning for a flutter beginner :D I do have a question though, what exactly is the BuildContext used for in saveImage for example?

  • @usamaqureshi82
    @usamaqureshi82 4 года назад

    Great.
    Sir please make a video on local notification in background.

  • @yoapps137
    @yoapps137 4 года назад

    Is there any particular reason you have not even once clicked on a notification and shown how you receive the payload?

  • @jeremydormevil5220
    @jeremydormevil5220 4 года назад

    Hi, Thanks for the tutorial ! Just wanted to ask, can we also add images or icons in the IOS notification or ?

  • @solomon1032
    @solomon1032 5 лет назад

    May I ask a question?
    Do you know how to play custom sound with notification when the app is closed?

  • @erperejildo
    @erperejildo 4 года назад

    Amazing content. Subscribed

  • @ashishtomer9197
    @ashishtomer9197 4 года назад

    Thankyou brother for the tutorial :)

  • @davidstevens6654
    @davidstevens6654 5 лет назад

    Thank you Johannes!!! Needed this..

  • @zeinab7278
    @zeinab7278 5 лет назад

    Awesome videos

  • @flutterwithvitul
    @flutterwithvitul 5 лет назад

    Hello sir thank you for this video
    but can we push notification when app not open?

    • @flutterwithvitul
      @flutterwithvitul 5 лет назад

      @@HeyFlutter Yes but in firebase not message notification is possible, i was already use thank you

    • @flutterwithvitul
      @flutterwithvitul 5 лет назад

      @@HeyFlutter i want to make image notification in local and even show if app is closed.

    • @aeggeska1
      @aeggeska1 4 года назад

      @@HeyFlutter I want to make a notification 45 minutes after the user has done a specific thing in the app, even if the app is closed, and it would have 2 buttons and a large image. Is that possible with Flutter?

  • @LifeCasts
    @LifeCasts 5 лет назад

    The thing I was looking for 😍