Git Product home page Git Product logo

woosignal / wp-json-api-flutter Goto Github PK

View Code? Open in Web Editor NEW
26.0 26.0 11.0 100 KB

WordPress and WooCommerce JSON API for Flutter Mobile. Register Users, Login (with email or username), Get Users Info, Update Users Info, Update Users Password + more.

Home Page: https://woosignal.com

License: BSD 2-Clause "Simplified" License

Dart 100.00%
dart flutter json json-api woocommerce woocommerce-api woocommerce-flutter wordpress wordpress-api wordpress-flutter

wp-json-api-flutter's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

wp-json-api-flutter's Issues

Result status and message null?

Hi,

I am using the plugin, which is great by the way, but i can't get the status code or the error message from the api callbacks?

Would like to implement some visual feedback to users depending on the error message or status code..

Using the WPUserLoginResponse method, and it works like a charme:

WPUserLoginResponse wpUserLoginResponse = await WPJsonAPI.instance.api(
  (request) {
    return request.wpLogin(
        username: username,
        password: password,
        authType: WPAuthType.WpUsername);
  },
);

if (wpUserLoginResponse != null) {
  userTokenId = wpUserLoginResponse.data.userToken;
  print(wpUserLoginResponse.message); // not working??
  getUser(userTokenId, context);
} else {
  print("invalid login details");
  print(wpUserLoginResponse.message); // not working??
  errorMessage = "invalid login details";
  loginState = LoginState.signedout;
  notifyListeners();
}

I keep getting this error:

E/flutter ( 9788): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The getter 'message' was called on null.
E/flutter ( 9788): Receiver: null
E/flutter ( 9788): Tried calling: message
E/flutter ( 9788): #0      Object.noSuchMethod  (dart:core-patch/object_patch.dart:53:5)
E/flutter ( 9788): #1      Wordpress.login 
package:mindmover/providers/wordpress.dart:45
E/flutter ( 9788): <asynchronous suspension>
E/flutter ( 9788): #2      _LoginPageState.build.<anonymous closure> 

Unable to login

/wp-json/wpapp/auth/v1/nonce

The login request send to this path, but the other library which able to login using path below

/wp-json/wp/v2/

WordPress 5.4.1
WooCommerce 4.1.1
woosignal: ^1.0.8
wp_json_api: ^0.1.2

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.