• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

urbanairship/java-library: Java client library for the Urban Airship API

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

urbanairship/java-library

开源软件地址(OpenSource Url):

https://github.com/urbanairship/java-library

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

Airship Java Client Library

This is the official supported Java library for the Airship API. Please reach out to http://support.airship.com directly with any issues that need attention.

Documentation

General documentation can be found here: http://docs.airship.com/ Java client library documentation can be found here: https://docs.airship.com/api/libraries/java/

Installation

Manual installation

Clone the repository, and use

    mvn package

to build the jar. Add the jar, located at a path similar to:

    target/java-client-<version>.jar

If you would like a copy of the javadocs, use

    mvn javadoc:javadoc

Maven Installation

Add the following to your pom.xml

    <!-- Urban Airship Library Dependency-->
    <dependency>
        <groupId>com.urbanairship</groupId>
        <artifactId>java-client</artifactId>
        <version>VERSION</version>
        <!-- Replace VERSION with the version you want to use -->
    </dependency>

Upgrading to 6.X.X

Schedule requests now require a SchedulePayload object:

    SchedulePayload schedulePayload = SchedulePayload.newBuilder()
        .setName("optionalName")
        .setSchedule(Schedule.newBuilder()
            .setScheduledTimestamp(dateTime)
            .build())
        .setPushPayload(PushPayload.newBuilder()
            .setDeviceTypes(DeviceTypeData.of(DeviceType.ANDROID))
            .setNotification(Notifications.alert("Simple alert"))
            .setAudience(Selectors.tag("tag"))
            .build())
        .build();

    ScheduleRequest scheduleRequest = ScheduleRequest.newRequest(schedulePayload);

Schedule responses now contain an Immutable list of SchedulePayloadResponse objects instead of SchedulePayload objects inside the response body.

    Response<ScheduleResponse> response = client.execute(scheduleRequest);
    ImmutableList<SchedulePayloadResponse> schedulePayloadResponses = response.getBody().get().getSchedulePayloadResponses();

When creating a custom event request the CustomEventBody now requires CustomEventPropertyValue objects to support complex property objects.

    CustomEventPropertyValue customEventProperty = CustomEventPropertyValue.of("victory");

    List<CustomEventPropertyValue> items = new ArrayList<>();
    items.add(CustomEventPropertyValue.of("la croix"));
    items.add(CustomEventPropertyValue.of("more la croix"));

    CustomEventBody customEventBody = CustomEventBody.newBuilder()
        .setName("purchased")
        .addPropertiesEntry("brand", customEventProperty)
        .addPropertiesEntry("items", CustomEventPropertyValue.of(items))
        .build();

    CustomEventPayload customEventPayload = CustomEventPayload.newBuilder()
        .setCustomEventBody(customEventBody)
        .setCustomEventUser(customEventUser)
        .setOccurred(occurred)
        .build();

CustomEventBody.getSessionId() will now return an Optional String instead of a String.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap