Bindambc / whatsapp-business-java-api

Whatsapp business api SDK, written in java. This SDK implements the Official Whatsapp Cloud API and WhatsApp Business Management API. These allows you to: manage your WhatsApp Business Account assets, such as message templates and phone numbers; send messages to your contacts, such as simple text messages, messages with buttons...
https://bindambc.github.io/whatsapp-business-java-api/
MIT License
137 stars 69 forks source link

issue running test #133

Open alkahtani opened 8 months ago

alkahtani commented 8 months ago

I am getting this error when running testing unit below

`WhatsappApiFactory factory = WhatsappApiFactory.newInstance(TestConstants.TOKEN);

    WhatsappBusinessCloudApi whatsappBusinessCloudApi = factory.newBusinessCloudApi();
    Message message = MessageBuilder.builder()//
            .setTo(PHONE_NUMBER_1)//
            .buildTextMessage(new TextMessage()//
                    .setBody(Formatter.bold("Hello world!") + "\nSome code here: \n" + Formatter.code("hello world code here"))//
                    .setPreviewUrl(false));

    MessageResponse messageResponse = whatsappBusinessCloudApi.sendMessage(PHONE_NUMBER_ID, message);

    System.out.println(messageResponse.toString());`

My Pom.xml :

`<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.7.17</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.waba.connector</groupId>
<artifactId>waba-connector</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>waba-connector</name>
<description>to connect to whatsapp api</description>
<properties>
    <java.version>1.8</java.version>
</properties>
<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>com.oracle.database.jdbc</groupId>
        <artifactId>ojdbc8</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.github.Bindambc</groupId>
        <artifactId>whatsapp-business-java-api</artifactId>
        <version>v0.3.4</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>
<repositories>
<repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

`

My JAVA Version : java 13.0.2 2020-01-14 Java(TM) SE Runtime Environment (build 13.0.2+8)

Please direct me

github-actions[bot] commented 8 months ago

Hello and welcome! We're glad to see that you've opened your first issue. We appreciate your contribution and would love to hear more about the problem you're experiencing. Our team is actively monitoring this repository and we will do our best to respond to your issue as soon as possible. Thank you for using our project and we look forward to working with you!

Bindambc commented 1 month ago

Hello @alkahtani, this WhatsApp SDK works only with Java versions 17 or higher.