Giter Site home page Giter Site logo

danieldai / android_metadata Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 3.0 1.2 MB

A flutter plugin to get metadata defined in AndroidManifest.xml

License: BSD 3-Clause "New" or "Revised" License

Java 20.78% Swift 6.75% Objective-C 11.70% Dart 23.49% Ruby 37.28%
android metadata flutter flutter-plugin

android_metadata's Introduction

android_metadata

A flutter plugin to get metadata defined in AndroidManifest.xml

Dart packages page

https://pub.dev/packages/android_metadata

Usage

import 'package:android_metadata/android_metadata.dart';

Map<String, String> metadata = Map();

metadata = await AndroidMetadata.metaDataAsMap;

Kindly powered by JetBrains

JetBrains

android_metadata's People

Contributors

danieldai avatar m123-dev avatar samuelhaws avatar

Stargazers

Roland Geider avatar Adam Zh. avatar

Watchers

James Cloos avatar  avatar

android_metadata's Issues

In the AndroidManifest.xml, Obtain the meta-data value may be integer type

In the flutter project, there has <meta-data android:name="flutterEmbedding" android:value="2" /> in the AndroidManifest.xml, which cause the exception as fellows.

I think it happened because it received the value of flutterEmbedding of meta-data that was an integer, not String.

Suggest that it not only gets String but also other basis types(integer). Or all convert String type when it generates.

java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
W/Bundle  ( 1425):      at android.os.BaseBundle.getString(BaseBundle.java:1199)
W/Bundle  ( 1425):      at com.mianjiajia.android_metadata.AndroidMetadataPlugin.onMethodCall(AndroidMetadataPlugin.java:50)
W/Bundle  ( 1425):      at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226)
W/Bundle  ( 1425):      at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
W/Bundle  ( 1425):      at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
W/Bundle  ( 1425):      at android.os.MessageQueue.nativePollOnce(Native Method)
W/Bundle  ( 1425):      at android.os.MessageQueue.next(MessageQueue.java:335)
W/Bundle  ( 1425):      at android.os.Looper.loop(Looper.java:183)
W/Bundle  ( 1425):      at android.app.ActivityThread.main(ActivityThread.java:7523)
W/Bundle  ( 1425):      at java.lang.reflect.Method.invoke(Native Method)
W/Bundle  ( 1425):      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
W/Bundle  ( 1425):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
I/flutter ( 1425): {flutterEmbedding: null}

Add method to put metadata values

I'm interested in updating the ApplicationInfo.metaData, specifically so that I can pass in an API KEY, rather than embedding it in the AndroidManifest.xml.

Specifically, doing something like:

metaData.putCharSequence(key, value);

where both key and value are Strings. However, support for other types may also be useful.

Is this supposed to work on iOS too?

The README does not say that this is Android only, so I assume that it should work with iOS too. However, I get the following stack trace:

[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method getMetaDataAsMap on channel plugins.mianjiajia.com/android_metadata)
#0      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:319:7)
<asynchronous suspension>
#1      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:349:48)
#2      AndroidMetadata.metaDataAsMap (package:android_metadata/android_metadata.dart:11:24)
#3      _HomeScreenState._buildHomeStatus.<anonymous closure> (package:myapp/screens/home_screen.dart:230:45)
#4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:706:14)
#5      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:789:36)
#6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
#7      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:486:11)
#8      BaseTapGestureRecognizer.<…>

Can you please clarify if this is supposed to function OK with iOS?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.