locked
How can I use Azure Notifications with Flutter apps? Has there been any documentation created for the same? RRS feed

  • Question

  • There are some dart packages that have been created by individuals for using azure notification hubs with flutter. But these seem to have many limitations and do not work for me. 

    Please let me know if any support has been created for integrating with flutter or if there is a Microsoft approved dart package that I may use.

    Thanks. 

    Saturday, April 25, 2020 9:48 AM

All replies

  • So, the error that shows is mostly on the MainActivity.java: here's the error that shows:
    FAILURE: Build failed with an exception.

    What went wrong:
    Execution failed for task ':app:processDebugResources'.
    Android resource linking failed
    Output: C:\projects_flutter_testes\flutter_messaging\android\app\src\main\res\layout\activity_main.xml:2: error: resource dimen/activity_vertical_margin (aka br.com.electra.fluttermessaging:dimen/activity_vertical_margin) not found.
    C:\projects_flutter_testes\flutter_messaging\android\app\src\main\res\layout\activity_main.xml:2: error: resource dimen/activity_horizontal_margin (aka br.com.electra.fluttermessaging:dimen/activity_horizontal_margin) not found.
    C:\projects_flutter_testes\flutter_messaging\android\app\src\main\res\layout\activity_main.xml:2: error: resource dimen/activity_horizontal_margin (aka br.com.electra.fluttermessaging:dimen/activity_horizontal_margin) not found.
    C:\projects_flutter_testes\flutter_messaging\android\app\src\main\res\layout\activity_main.xml:2: error: resource dimen/activity_vertical_margin (aka br.com.electra.fluttermessaging:dimen/activity_vertical_margin) not found.
    C:\projects_flutter_testes\flutter_messaging\android\app\src\main\res\layout\activity_main.xml:18: error: resource string/send_button (aka br.com.electra.fluttermessaging:string/send_button) not found.
    C:\projects_flutter_testes\flutter_messaging\android\app\src\main\res\layout\activity_main.xml:27: error: resource string/notification_message_hint (aka br.com.electra.fluttermessaging:string/notification_message_hint) not found.
    error: failed linking file resources.

    Command: C:\Users\jcesar.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\a2663eefe8efa16417feae0b28315db3\aapt2-3.2.1-4818971-windows\aapt2.exe link -I
    C:\Users\jcesar\AppData\Local\Android\Sdk\platforms\android-27\android.jar
    --manifest
    C:\projects_flutter_testes\flutter_messaging\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml
    -o
    C:\projects_flutter_testes\flutter_messaging\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_
    -R
    @C:\projects_flutter_testes\flutter_messaging\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt
    --auto-add-overlay
    --java
    C:\projects_flutter_testes\flutter_messaging\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r
    --custom-package
    br.com.electra.fluttermessaging
    -0
    apk
    --output-text-symbols
    C:\projects_flutter_testes\flutter_messaging\build\app\intermediates\symbols\debug\R.txt
    --no-version-vectors
    Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
    Output: C:\projects_flutter_testes\flutter_messaging\android\app\src\main\res\layout\activity_main.xml:2: AAPT: error: resource dimen/activity_vertical_margin (aka br.com.electra.fluttermessaging:dimen/activity_vertical_margin) not found.

    C:\projects_flutter_testes\flutter_messaging\android\app\src\main\res\layout\activity_main.xml:2: AAPT: error: resource dimen/activity_horizontal_margin (aka br.com.electra.fluttermessaging:dimen/activity_horizontal_margin) not found.

    C:\projects_flutter_testes\flutter_messaging\android\app\src\main\res\layout\activity_main.xml:18: AAPT: error: resource string/send_button (aka br.com.electra.fluttermessaging:string/send_button) not found.

    C:\projects_flutter_testes\flutter_messaging\android\app\src\main\res\layout\activity_main.xml:27: AAPT: error: resource string/notification_message_hint (aka br.com.electra.fluttermessaging:string/notification_message_hint) not found.

    error: failed linking file resources.
    Command: C:\Users\jcesar.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\a2663eefe8efa16417feae0b28315db3\aapt2-3.2.1-4818971-windows\aapt2.exe link -I
    C:\Users\jcesar\AppData\Local\Android\Sdk\platforms\android-27\android.jar
    --manifest
    C:\projects_flutter_testes\flutter_messaging\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml
    -o
    C:\projects_flutter_testes\flutter_messaging\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_
    -R
    @C:\projects_flutter_testes\flutter_messaging\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt
    --auto-add-overlay
    --java
    C:\projects_flutter_testes\flutter_messaging\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r
    --custom-package
    br.com.electra.fluttermessaging
    -0
    apk
    --output-text-symbols
    C:\projects_flutter_testes\flutter_messaging\build\app\intermediates\symbols\debug\R.txt
    --no-version-vectors
    Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
    Saturday, April 25, 2020 11:16 AM
  • Hi this is using which dart package? Also, is there then a way to integrate Azure Notifications Hub with Flutter?
    Monday, April 27, 2020 3:07 AM
  • Hi rumzib, as noted on this Azure Feedback page, Flutter is not officially supported. There are a number of unofficial ways you can attempt to integrate Azure Notification Hubs with Flutter but they are use as is and risk not working with future versions of Notification Hub.

    The latest update we have is that the product group is investigating Flutter integration and that it was planned. At this time, there is nothing else we can share in terms of the roadmap.

    Wednesday, April 29, 2020 9:53 PM