Skip to content

Commit 79bc91b

Browse files
committed
adding new pinpoint example topics
1 parent c578b3b commit 79bc91b

File tree

4 files changed

+254
-0
lines changed

4 files changed

+254
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
.. Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
3+
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0
4+
International License (the "License"). You may not use this file except in compliance with the
5+
License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/.
6+
7+
This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
8+
either express or implied. See the License for the specific language governing permissions and
9+
limitations under the License.
10+
11+
################################
12+
Creating a Campaign in |PINlong|
13+
################################
14+
15+
.. meta::
16+
:description: How to create a campaign in Amazon pinpoint.
17+
:keywords: AWS for Java SDK code examples, amazon pinpoint campaign
18+
19+
Campaigns are used to help increase engagement between your app and your users.
20+
You can create a campaign to reach out to a particular segment of your users with tailored
21+
messages or special promotions. This example demonstrates how to create a new
22+
standard campaign that sends a custom push notification to a specified segment.
23+
24+
Create a Campaign
25+
=================
26+
27+
Before creating a new campaign, you must define a :aws-java-class:`Schedule
28+
<services/pinpoint/model/Schedule>` and a :aws-java-class:`Message
29+
<services/pinpoint/model/Message>` and set these values in a
30+
:aws-java-class:`WriteCampaignRequest <services/pinpoint/model/WriteCampaignRequest>` object.
31+
32+
**Imports**
33+
34+
.. literalinclude:: example_code/pinpoint/src/main/java/com/example/pinpoint/CreateCampaign.java
35+
:lines: 18-27
36+
:language: java
37+
38+
**Code**
39+
40+
.. literalinclude:: example_code/pinpoint/src/main/java/com/example/pinpoint/CreateCampaign.java
41+
:lines: 53-69
42+
:dedent: 8
43+
:language: java
44+
45+
Then create a new campaign in |PINlong| by providing the :aws-java-class:`WriteCampaignRequest
46+
<services/pinpoint/model/WriteCampaignRequest>` with the campaign configuration to a
47+
:aws-java-class:`CreateCampaignRequest` object. Finally pass the CreateCampaignRequest object to the
48+
|pinpointclient|'s :methodname:`createCampaign` method.
49+
50+
**Code**
51+
52+
.. literalinclude:: example_code/pinpoint/src/main/java/com/example/pinpoint/CreateCampaign.java
53+
:lines: 71-74
54+
:dedent: 8
55+
:language: java
56+
57+
See the :sdk-examples-java-pinpoint:`complete example <CreateApp.java>` on GitHub.
58+
59+
More Information
60+
================
61+
62+
* See :pin-ug:`Amazon Pinpoint Campaigns <campaigns>` in the |pin-ug|
63+
* See :pin-dg:`Creating Campaigns <campaigns>` in the |pin-dg|
64+
* See :pin-api:`Campaigns <campaigns>` in the |pin-api|
65+
* See :pin-api:`Campaign <campaign>` in the |pin-api|
66+
* See :pin-api:`Campaign Activities <campaign-activities>` in the |pin-api|
67+
* See :pin-api:`Campaign Versions <campaign-versions>` in the |pin-api|
68+
* See :pin-api:`Campaign Version <campaign-version>` in the |pin-api|
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
.. Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
3+
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0
4+
International License (the "License"). You may not use this file except in compliance with the
5+
License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/.
6+
7+
This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
8+
either express or implied. See the License for the specific language governing permissions and
9+
limitations under the License.
10+
11+
##############################
12+
Creating Endpoint in |PINlong|
13+
##############################
14+
15+
.. meta::
16+
:description: How to update an app endpoint in Amazon pinpoint.
17+
:keywords: AWS for Java SDK code examples, amazon pinpoint endpoint
18+
19+
An endpoint uniquely identifies a user device to which you can send
20+
push notifications with |PINlong|. If your app is enabled with |PINlong|
21+
support, your app automatically registers an endpoint with |PINlong|
22+
when a new user opens your app. The following example demonstrates how to set
23+
add a new endpoint programmatically.
24+
25+
Create an Endpoint
26+
==================
27+
28+
Create a new endpoint in |PINlong| by providing the endpoint data in an
29+
:aws-java-class:`EndpointRequest <services/pinpoint/model/EndpointRequest>` object.
30+
31+
**Imports**
32+
33+
.. literalinclude:: example_code/pinpoint/src/main/java/com/example/pinpoint/CreateEndpoint.java
34+
:lines: 18-28
35+
:language: java
36+
37+
**Code**
38+
39+
.. literalinclude:: example_code/pinpoint/src/main/java/com/example/pinpoint/CreateEndpoint.java
40+
:lines: 92-136
41+
:dedent: 8
42+
:language: java
43+
44+
Then create an :aws-java-class:`UpdateEndpointRequest <services/pinpoint/model/UpdateEndpointRequest>`
45+
object with that EndpointRequest object. Finally pass the UpdateEndpointRequest object to the
46+
|pinpointclient|'s :methodname:`updateEndpoint` method.
47+
48+
**Code**
49+
50+
.. literalinclude:: example_code/pinpoint/src/main/java/com/example/pinpoint/CreateEndpoint.java
51+
:lines: 73-79
52+
:dedent: 8
53+
:language: java
54+
55+
See the :sdk-examples-java-pinpoint:`complete example <CreateEndpoint.java>` on GitHub.
56+
57+
58+
More Information
59+
================
60+
61+
* See :pin-dg:`Adding Endpoint <endpoints>` in the |pin-dg|
62+
* See :pin-api:`Endpoint <endpoint>` in the |pin-api|
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
.. Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
3+
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0
4+
International License (the "License"). You may not use this file except in compliance with the
5+
License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/.
6+
7+
This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
8+
either express or implied. See the License for the specific language governing permissions and
9+
limitations under the License.
10+
11+
#############################
12+
Creating Segment in |PINlong|
13+
#############################
14+
15+
.. meta::
16+
:description: How to update an app segment in Amazon pinpoint.
17+
:keywords: AWS for Java SDK code examples, amazon pinpoint segment
18+
19+
A user segment represents a subset of your users based on shared characteristics such as
20+
how recently a user opened your app or which device they use. The example below demonstrates
21+
how to define a segment of users.
22+
23+
Create a Segment
24+
================
25+
26+
Create a new segment in |PINlong| by defining dimensions of the segment in a
27+
:aws-java-class:`SegmentDimensions <services/pinpoint/model/SegmentDimensions>` object.
28+
29+
**Imports**
30+
31+
.. literalinclude:: example_code/pinpoint/src/main/java/com/example/pinpoint/CreateSegment.java
32+
:lines: 18-30
33+
:language: java
34+
35+
**Code**
36+
37+
.. literalinclude:: example_code/pinpoint/src/main/java/com/example/pinpoint/CreateSegment.java
38+
:lines: 50, 58-74
39+
:dedent: 8
40+
:language: java
41+
42+
Then set the :aws-java-class:`SegmentDimensions <services/pinpoint/model/SegmentDimensions>`
43+
object in a :aws-java-class:`WriteSegmentRequest
44+
<services/pinpoint/model/WriteSegmentRequest>` which in turn is used to create a
45+
:aws-java-class:`CreateSegmentRequest <services/pinpoint/model/CreateSegmentRequest>` object.
46+
Then pass the CreateSegmentRequest object to the
47+
|pinpointclient|'s :methodname:`createSegment` method.
48+
49+
**Code**
50+
51+
.. literalinclude:: example_code/pinpoint/src/main/java/com/example/pinpoint/CreateSegment.java
52+
:lines: 76-82
53+
:dedent: 8
54+
:language: java
55+
56+
See the :sdk-examples-java-pinpoint:`complete example <CreateSegment.java>` on GitHub.
57+
58+
More Information
59+
================
60+
61+
* See :pin-ug:`Amazon Pinpoint Segments <segments>` in the |pin-ug|
62+
* See :pin-dg:`Creating Segments <segments>` in the |pin-dg|
63+
* See :pin-api:`Segments <segments>` in the |pin-api|
64+
* See :pin-api:`Segment <segment>` in the |pin-api|
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
.. Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
3+
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0
4+
International License (the "License"). You may not use this file except in compliance with the
5+
License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/.
6+
7+
This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
8+
either express or implied. See the License for the specific language governing permissions and
9+
limitations under the License.
10+
11+
#############################
12+
Updating Channel in |PINlong|
13+
#############################
14+
15+
.. meta::
16+
:description: How to update an app channel in Amazon pinpoint.
17+
:keywords: AWS for Java SDK code examples, amazon pinpoint channel
18+
19+
A channel defines the types of platforms to which you can deliver messages.
20+
This example shows how to use the APNs channel to send a message.
21+
22+
Update a Channel
23+
================
24+
25+
Enable a channel in |PINlong| by providing an app ID and a request object of the channel type
26+
you want to update. This example updates the APNs channel which requires the
27+
:aws-java-class:`APNSChannelRequest <services/pinpoint/model/APNSChannelRequest>` object.
28+
Set these in the :aws-java-class:`UpdateApnsChannelRequest <services/pinpoint/model/UpdateApnsChannelRequest>`
29+
and pass that object to the
30+
|pinpointclient|'s :methodname:`updateApnsChannel` method.
31+
32+
**Imports**
33+
34+
.. literalinclude:: example_code/pinpoint/src/main/java/com/example/pinpoint/UpdateChannel.java
35+
:lines: 18-25
36+
:language: java
37+
38+
**Code**
39+
40+
.. literalinclude:: example_code/pinpoint/src/main/java/com/example/pinpoint/UpdateChannel.java
41+
:lines: 66-72
42+
:dedent: 2
43+
:language: java
44+
45+
See the :sdk-examples-java-pinpoint:`complete example <CreateApp.java>` on GitHub.
46+
47+
48+
More Information
49+
================
50+
51+
* See :pin-ug:`Amazon Pinpoint Channels <channels>` in the |pin-ug|
52+
* See :pin-api:`ADM Channel <adm-channel>` in the |pin-api|
53+
* See :pin-api:`APNs Channel <apns-channel>` in the |pin-api|
54+
* See :pin-api:`APNs Sandbox Channel <apns-sandbox-channel>` in the |pin-api|
55+
* See :pin-api:`APNs VoIP Channel <apns-voip-channel>` in the |pin-api|
56+
* See :pin-api:`APNs VoIP Sandbox Channel <apns-voip-sandbox-channel>` in the |pin-api|
57+
* See :pin-api:`Baidu Channel <baidu-channel>` in the |pin-api|
58+
* See :pin-api:`Email Channel <email-channel>` in the |pin-api|
59+
* See :pin-api:`GCM Channel <gcm-channel>` in the |pin-api|
60+
* See :pin-api:`SMS Channel <sms-channel>` in the |pin-api|

0 commit comments

Comments
 (0)