0.1.42 • Published 4 years ago

popdeem-cordova-plugin v0.1.42

Weekly downloads
1
License
Apache 2.0
Repository
github
Last release
4 years ago

Popdeem Cordova Plugin

The Popdeem Cordova plugin allows you to use the Popdeem native iOS and Android SDKs inside your Cordova cross-platform application. Currently iOS and Android are supported

Usage

Add the plugin to your project

cordova plugin add popdeem-cordova-plugin

Build the projects

cordova build ios \ cordova build android

This will result in the PopdeemSDK pod being pulled into your iOS project, and the PopdeemSDK maven library being pulled into your Android project.

Configuration

iOS

Adding item to info.plist

Configuration items must be added to the info.plist file of the iOS project. To do this, you can use the hook file from this gist: update_platform_config and add items in the config.xml file of your project.

Add the hook

Add the file update_platform_config.js to hooks/after_prepare directory (create if needed). Add the following line to config.xml: <hook src="hooks/after_prepare/update_platform_config.js" type="after_prepare" />

Add the following inside the <platform name=“ios”> tags:

<config-file parent="PopdeemApiKey" target="*-Info.plist">
<string>POPDEEM_API_KEY</string>
</config-file>
<config-file parent="PopdeemThemeFileName" target="*-Info.plist">
<string>theme</string>
</config-file>
<config-file parent="FacebookAppID" target="*-Info.plist">
<string>FACEBOOK_APP_ID</string>
</config-file>
<config-file parent="FacebookDisplayName" target="*-Info.plist">
<string>Popdeem</string>
</config-file>
<config-file parent="FacebookNamespace" target="*-Info.plist">
<string>popdeemrewards</string>
</config-file>
<config-file parent="FacebookUrlSchemeSuffix" target="*-Info.plist">
<string>ribsburgers</string>
</config-file>
<config-file parent="TwitterAppConsumerKey" target="*-Info.plist">
<string>TWITTER_CONSUMER_KEY</string>
</config-file>
<config-file parent="TwitterAppConsumerSecret" target="*-Info.plist">
<string>TWITTER_CONSUMER_SECRET</string>
</config-file>
<config-file parent="TwitterCallbackScheme" target="*-Info.plist">
<string>TWITTER_CALLBACK</string>
</config-file>
<config-file parent="InstagramClientId" target="*-Info.plist">
<string>INSTAGRAM_CLIENT_ID</string>
</config-file>
<config-file parent="InstagramClientSecret" target="*-Info.plist">
<string>INSTAGRAM_CLIENT_SECRET</string>
</config-file>
<config-file parent="InstagramCallback" target="*-Info.plist">
<string>https://www.popdeem.com/igredirect</string>
</config-file>
<config-file parent="CFBundleURLTypes" target="*-Info.plist">
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>FACEBOOK_APP_ID</string>

<string>TWITTER_CALLBACK</string>
</array>
</dict>
</array>
</config-file>
<config-file parent="NSLocationWhenInUseUsageDescription" target="*-
Info.plist">
<string>We use your location to deliver local rewards.</string>
</config-file>
<config-file parent="NSCameraUsageDescription" target="*-Info.plist">
<string>We need access to your camera when you decide to share a
photo.</string>
</config-file>
<config-file parent="NSPhotoLibraryUsageDescription" target="*-
Info.plist">
<string>We access your photo gallery when you decide to share a
photo.</string>
</config-file>
<config-file parent="LSApplicationQueriesSchemes" target="*-
Info.plist">
<array>
<string>instagram</string>
<string>fbapi</string>
<string>fbapi20130214</string>
<string>fbapi20130410</string>
<string>fbapi20130702</string>
<string>fbapi20131010</string>
<string>fbapi20131219</string>
<string>fbapi20140410</string>
<string>fbapi20140116</string>
<string>fbapi20150313</string>
<string>fbapi20150629</string>
<string>fbauth</string>
<string>fbauth2</string>
<string>fb-messenger-api20140430</string>
</array>
</config-file>

Add image and json Assets

Add the images and theme.json in your project, for example in a folder named Popdeem . Add the following entries to config.xml inside the <platform name=“ios”> tags.

<resource-file src="Popdeem/theme.json" target="Resources/theme.json" />
<resource-file src="Popdeem/Ribs&Burgers_Header.png" target="Resources/
FarmBoy_Header.png" />
<resource-file src="Popdeem/Ribs&Burgers_Header@2x.png" target="Resources/
FarmBoy_Header@2x.png" />
<resource-file src="Popdeem/Ribs&Burgers_Header@3x.png" target="Resources/
FarmBoy_Header@3x.png" />

Android

Inside the hooks/android folder, add the hook in this gist named beforePluginInstall.js: beforePluginInstall.js

In config.xml, add the following inside the <platform name=“android”> tags:

<hook src="hooks/android/beforePluginInstall.js" type="after_prepare" />
<allow-intent href="market:*" />
<config-file parent="/*" target="AndroidManifest.xml">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</config-file>
<config-file parent="./application" target="AndroidManifest.xml">
<meta-data android:name="com.popdeem.sdk.ApiKey" android:value="POPDEEM_API_KEY" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_application_id" />
<meta-data android:name="TwitterConsumerKey" android:value="TWIITER_CONSUMER_KEY" />
<meta-data android:name="TwitterConsumerSecret" android:value="TWITTER_CONSUMER_SECRET" />
<meta-data android:name="InstagramClientId" android:value="INSRAGRAM_CLIENT_D" />
<meta-data android:name="InstagramClientSecret" android:value="INSTAGRAM_CLIENT_SECRET" />
<meta-data android:name="InstagramCallbackUrl" android:value="https://www.popdeem.com/igredirect" />
</config-file>
<config-file parent="./application" target="AndroidManifest.xml">
<activity android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" android:name="com.facebook.FacebookActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
</config-file>
<config-file parent="/*" target="res/values/strings.xml">
<string name="facebook_application_id">FACEBOOK_APP_ID</string>
<string name="pd_wallet_title">History</string>
<string name="pd_home_banner_text">Share your experience on social networks to earn more rewards.</string>
</config-file>
<resource-file src="Popdeem/colors.xml" target="res/values/colors.xml" />
<resource-file src="Popdeem/drawable/hdpi/pd_home_banner.png" target="res/drawable-port-hdpi/pd_home_banner.png" />
<resource-file src="Popdeem/drawable/mdpi/pd_home_banner.png" target="res/drawable-port-mdpi/pd_home_banner.png" />
<resource-file src="Popdeem/drawable/xhdpi/pd_home_banner.png" target="res/drawable-port-xhdpi/pd_home_banner.png" />
<resource-file src="Popdeem/drawable/xxhdpi/pd_home_banner.png" target="res/drawable-port-xxhdpi/pd_home_banner.png" />
<resource-file src="Popdeem/drawable/xxxhdpi/pd_home_banner.png" target="res/drawable-port-xxxhdpi/pd_home_banner.png" />

Social Login

To launch the social login popover from javascript, use the following: popdeem.enableSocialLogin(3, function() {}, function() {}); The first parameter is the numberOfPrompts argument. The popover is dismissible by the user - this argument denotes the maximum number of times a user can see this popover.

Popdeem Home

To show the Popdeem Home flow from javascript, use the following: popdeem.pushPopdeemHome(function() {}, function() {});. Popdeem Home encapsulates all of Popdeem’s functionality.

Deliver Third Party Token

We may need you to deliver a user token. If so, you can do this by using this method: popdeem.deliverThirdPartyToken(“ThirdPartyToken", function() {}, function() {});.

0.1.42

4 years ago

0.1.41

4 years ago

0.1.40

4 years ago

0.1.39

4 years ago

0.1.38

4 years ago

0.1.37

4 years ago

0.1.36

4 years ago

0.1.35

4 years ago

0.1.34

4 years ago

0.1.33

4 years ago

0.1.32

5 years ago

0.1.31

5 years ago

0.1.30

5 years ago

0.1.29

5 years ago

0.1.28

5 years ago

0.1.27

5 years ago

0.1.26

5 years ago

0.1.25

5 years ago

0.1.24

5 years ago

0.1.23

5 years ago

0.1.22

5 years ago

0.1.21

5 years ago

0.1.20

5 years ago

0.1.19

5 years ago

0.1.18

5 years ago

0.1.17

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.9.61

6 years ago

0.9.60

6 years ago

0.1.11

6 years ago

0.1.1

6 years ago

0.9.59

6 years ago

0.1.0

6 years ago

0.9.58

6 years ago

0.9.57

6 years ago

0.9.56

6 years ago

0.9.55

6 years ago

0.9.54

6 years ago

0.9.52

6 years ago

0.9.51

6 years ago

0.9.50

6 years ago

0.9.49

6 years ago

0.9.48

6 years ago

0.9.47

6 years ago

0.9.46

6 years ago

0.9.45

6 years ago

0.9.44

6 years ago

0.9.43

6 years ago

0.9.42

6 years ago

0.9.41

6 years ago

0.9.40

6 years ago

0.9.39

6 years ago

0.9.38

6 years ago

0.9.37

6 years ago

0.9.36

6 years ago

0.9.35

6 years ago

0.9.34

6 years ago

0.9.33

6 years ago

0.9.31

6 years ago

0.9.30

6 years ago

0.9.29

6 years ago

0.9.28

6 years ago

0.9.27

6 years ago

0.9.26

6 years ago

0.9.25

6 years ago

0.9.23

6 years ago

0.9.22

6 years ago

0.9.21

6 years ago

0.9.20

6 years ago

0.9.19

6 years ago

0.9.18

6 years ago

0.9.17

6 years ago

0.9.16

7 years ago

0.9.15

7 years ago

0.9.12

7 years ago

0.9.11

7 years ago

0.9.10

7 years ago

0.9.8

7 years ago

0.9.7

7 years ago

0.9.6

7 years ago

0.9.5

7 years ago

0.9.4

7 years ago

0.9.3

7 years ago

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.3.23

7 years ago

0.3.22

7 years ago

0.3.21

7 years ago

0.3.20

7 years ago

0.3.19

7 years ago

0.3.18

7 years ago

0.3.17

7 years ago

0.3.16

7 years ago

0.3.15

7 years ago

0.3.14

7 years ago

0.3.13

7 years ago

0.3.12

7 years ago

0.3.11

7 years ago

0.3.10

7 years ago

0.3.9

7 years ago

0.3.8

7 years ago

0.3.7

7 years ago

0.3.6

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.0

7 years ago

0.2.11

7 years ago

0.2.10

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago