Codota Logo
LineMessagingClient.pushMessage
Code IndexAdd Codota to your IDE (free)

How to use
pushMessage
method
in
com.linecorp.bot.client.LineMessagingClient

Best Java code snippets using com.linecorp.bot.client.LineMessagingClient.pushMessage (Showing top 1 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: line/line-bot-sdk-java

  @Override
  public void execute() throws Exception {
    // Actually this command always use multicast command to support multiple targets.
    final Multicast multicast = payloadProvider.read(Multicast.class);
    final BotApiResponse botApiResponse;

    if (multicast.getTo().size() == 1) {
      // Send using pushMessage
      final String userId = multicast.getTo().iterator().next();
      final PushMessage pushMessage = new PushMessage(userId, multicast.getMessages());
      botApiResponse = lineMessagingClient.pushMessage(pushMessage).get();
    } else {
      // Send using multicast
      if (multicast.getMessages().stream().anyMatch(message -> message instanceof FlexMessage)) {
        log.warn("multicast FlexMessage is not supported as of 2018/07. "
             + "If you got exception. Try with single `to`.");
      }

      botApiResponse = lineMessagingClient.multicast(multicast).get();
    }

    log.info("Successfully finished: {}", botApiResponse);
  }
}
com.linecorp.bot.clientLineMessagingClientpushMessage

Javadoc

Send messages to users when you want to.

INFO: Use of the Push Message API is limited to certain plans.

Popular methods of LineMessagingClient

  • builder
  • replyMessage
  • deleteRichMenu
    Deletes a rich menu.
  • createRichMenu
    Creates a rich menu.Note: You must upload a rich menu image and link the rich menu to a user for the
  • getMessageContent
    Download image, video, and audio data sent from users.
  • getProfile
    Get user profile information.
  • getRichMenu
    Get a rich menu.
  • getRichMenuIdOfUser
    Get rich menu ID of user.
  • getRichMenuImage
    Download rich menu image.
  • getRichMenuList
    Gets a list of all uploaded rich menus.
  • linkRichMenuIdToUser
    Link rich menu to user.
  • multicast
    Send messages to multiple users at any time. IDs of groups or rooms cannot be used.INFO: Only availa
  • linkRichMenuIdToUser,
  • multicast,
  • setRichMenuImage,
  • unlinkRichMenuIdFromUser

Popular in Java

  • Running tasks concurrently on multiple threads
  • getResourceAsStream (ClassLoader)
  • getSystemService (Context)
  • startActivity (Activity)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now