import { NativeModules } from 'react-native';

const { LineSDKManager } = NativeModules;

class LineSDK {
  /**
   * Logs the user.
   */
  login = () => {
    return LineSDKManager.login();
  }

  /**
   * Logs the user in with the requested permissions.
   */
  loginWithPermissions = (permissions) => {
    return LineSDKManager.loginWithPermissions(permissions);
  }

  /**
   * Get the current access token.
   */
  currentAccessToken = () => {
    return LineSDKManager.currentAccessToken();
  }

  /**
   * Get user profile.
   */
  getUserProfile = () => {
    return LineSDKManager.getUserProfile();
  }  

  /**
   * Logs out the user.
   */
  logout = () => {
    LineSDKManager.logout();
  }
}

export default new LineSDK();
