Archives

How to set up in apps purchase in Android (for dev)

You can only set up a one-time or recurring plan on your platform. Both types cannot be used at the same time.

To find out how to set up in-apps purchases for buying recurring subscription and how to set up server to receive Plays Store server notification, please refer How to set up in apps purchase in Android (for client)

TEST PLAY STORE SERVER NOTIFICATION

  1. Go to Play console: https://play.google.com/apps/publish
  2. Select your app

  1. Scroll to Monetize, click on Monetization setup

inapp_android_12

  1. Click on Send test notification

inapp_android_25

  1. Go to Google console: https://console.cloud.google.com/
  2. At Navigation menu, scroll to ANALYTICS section, click on Pub/Sub

inapp_android_26

  1. Click on Topic ID

inapp_android_27

  1. Click on subscription ID

inapp_android_28

  1. You can view the request count at METRICS tab

CREATE TEST ACCOUNT

  1. Go to Play console: https://play.google.com/apps/publish
  2. Select the app you want to create test account

inapp_android_24

  1. At Navigation menu, scroll to Testing section, click on Internal testing and select Testers tab

  1. Click on Create email list

  1. Create email list

(1) List name: Enter your list name

(2)  Add email address: Enter email address of testers

(3) Upload CSV file: If not enter email at (2), you can upload csv file here

(4) Email addresses added: List the email that you enter or upload

(5) Save changes

  1. Enable the list name and click on Save button

TESTING IN APPS PURCHASE ON DEVICE

  1. Open Play Store and login the email you created test account

  1. Open your app and buy subscription, you will see the test card

inapp_android_29

  1. Click on the test card, you can choose the case to test: approve or decline.

inapp_android_30

  1. After buy subscription successfully (approve or decline), you can view the order manager by accessing https://play.google.com/console and opening Order Management menu

inapp_android_31

Note: Renewal periods: Test subscriptions renew more quickly than actual subscriptions, and test subscriptions can renew a maximum of six times.

The following table lists the testing renewal times for subscriptions of various durations. These times are approximate.

How to set up in apps purchase in Android (for client)

You can only set up a one-time or recurring plan on your platform. Both types cannot be used at the same time.

To find out how to create test account and how to test in-apps purchase with real device, please refer How to set up in apps purchase in Android (for dev)

ADD ANDROID APP PACKAGE NAME

  1. Go to Google Play Console: https://play.google.com/console
  2. Copy your App Package nameinapp_android_1

3. Open Admin Panel, click on Subscription menu 

inapp_android_2

4. Paste the App Package name that you copy to Android app package name field and save changes

inapp_android_3

SET UP IN-APPS PURCHASES FOR BUYING RECURRING SUBSCRIPTION

  1. Open your site, go to AdminCP -> System Admin -> Subscription -> Manage Packages.
  2. Edit Package -> create new Plan -> setting all information and click the Save Changes button

(1) Plan Type: select One Time plan

(2) Title: enter plan title

(3) Price: enter plan price

(4) Plan Duration: setting plan duration

(5) Expiration Reminder: setting expiration reminder

(6) Show at: select Manage Membership

(7) Android Product Id:  enter Android Product Id. This is a unique alphanumeric ID. After you use an Android Product ID for one product, it can’t be used again, even if the product is deleted.

(8) Ios Product Id:

(9) App recurring: tick on

(10) Enable Plan: tick on

3. Go to Play consolehttps://play.google.com/apps/publish

4. Select your app

5. Scroll to Monetize, click on Subscription (under Product)

6. Click on Create subscription button

7. Enter Product ID and Name and click the Create button. Product ID is the Android Product Id that you create in step #2.

Product ID must be unique for your app, and they can’t be changed or reused after they’ve been created.

8. After creating a new subscription, you will be redirected to this subscription detail page. At Base plans and offers section, click on Add base plan.

9. Enter base plan information

(1) Base plan ID: enter a base plan ID. The base plan ID must be unique for your app, and it can’t be changed or reused after it’s been created.

(2) Type: select Auto-renewing.

(3) Billing period: select the period matches the Plan Duration that you setting in step #2.

(4) Grace period: can use the default value (3 days).

(5) Customer base plan and offer changes: select Charge immediately.

(6) Resubscribe: select allow.

10. Scroll to the Price and availability section, click on Set prices.

11. Select all the countries and click on Set price button.

12. Enter price and select currency that match the Price you setting in step #2 and click on Update button.

13. Click on Save button.

Note: Please do not delete products and base plan (step #7 and step #9). You cannot reuse the Product ID and Base plan ID even if you delete the package.

 

SET UP SERVER TO RECEIVE PLAY STORE SERVER NOTIFICATION

  1. Go to Google console: https://console.cloud.google.com/
  2. At Navigation menu, scroll to ANALYTICS section, click on Pub/Subinapp_android_4
  1. Click on CREATE TOPIC

inapp_android_5

  1. Enter Topic ID and click on CREATE BUTTON

inapp_android_6

  1. After creating a new topic, you will be redirected to this topic detail page. Copy Topic name.

inapp_android_7

  1. Click on ADD PRINCIPAL button

inapp_android_8

  1. Enter principal information and click on SAVE button

(1) New principal: enter “google-play-developer-notifications@system.gserviceaccount.com

(2) Role: select Pub/Sub -> Pub/Sub Publisher

8. When creating a topic, the system will automatically create a subscription. Click on this subscription to view subscription detail page

inapp_android_9

9. Click on EDIT

inapp_android_10

10. Setting subscription and click on UPDATE button

  1. Delivery type: select Push
  2. Endpoint URL: enter [yourwebsite]/subscription/subscribe_public/notification_android

Ex: https://moosocial.com/subscription/subscribe_public/notification_android

inapp_android_11

11. Go to Play console: https://play.google.com/apps/publish

12. Select your app

13. Scroll to Monetize, click on Monetization setup

inapp_android_12

14.  Enter the Topic name that you copy in step #5 and click on Save Changes button

inapp_android_13

SETUP SERVICE ACCOUNT

  1. Go to Google consolehttps://console.cloud.google.com/
  2. At Navigation menu, scroll to APIs & Services section, click on Library

inapp_android_14

  1. Search to find “Google Play Android Developer API

inapp_android_15

  1. Open Google Play Android Developer API and enable

  1. At Navigation menu, scroll to IAM & Admin section, click on Service Accounts

inapp_android_16

 

  1. Click on CREATE SERVICE ACCOUNT

  1. Create service account

7.1. Service account details:

(1) Service account name: Enter an arbitrary Service account name

(2) Service account ID: Service account ID will be automatically generated from your Service account name. You don’t need to change it

(3) Service account description: This is optional field

(4). CREATE AND CONTINUE: click to create account and move to next step

7.2. Grant this service account access to project:

(1) Select a role: Open dropdown and select Basic -> Editor

(2) ADD ANOTHER ROLE: click to add more role
You need to add one more role: 
IAM -> Security Admin

(3) CONTINUE: click to move to next step

7.3. Grant users access to this service account

You do not need to set up this step. Click Continue

  1. There is an email that will be automatically generated. Please copy this email for use in the next stage. I will refer to this email as Email (1) for the rest of the tutorial.

Click on the email just created.

  1. Select KEYS

  1. Click on CREATE KEY button, select Create new key

  1. Select Key type is JSON and click on CREATE button

Now, you will download a json file. Please change the file name to “service_account.json” and keep this file for use in the next stage.

UPLOAD JSON FILE

  1. Go to your host server -> open database
  2. Redirect to ../app/Plugin/Subscription/Lib/
  3. Upload the file “service_account.json

ADD USERS AND PERMISSIONS

  1. Go to https://play.google.com/console/
  2. Click on Users and Permissions menu

inapp_android_18

  1. Click on Invite new users

inapp_android_19

  1. Email address: Enter Email (1)

inapp_android_20

  1. Click on Add app, select the app you want to set up users and click on Apply

inapp_android_21

  1. Select the permissions and click on Apply:
  • View app information (read-only)
  • View app quality information (read-only)
  • View financial data
  • Manage orders and subscriptions

inapp_android_22

  1. Click on Inviter user and confirm to send invite

inapp_android_23

How to setup OpenID Connect?

By using OpenID Connect, your members can sign up/in using any social media account
In this article, I will show you how you can quickly config the Facebook, Twitter, Google and Linkedin application for OpenID Connect.

CONFIG FACEBOOK

1/ Go to developers.facebook.com

2/ Login & select My apps/Add a New App

3/ Select an app type: select Consumer and click Next button

2

4/ Fill in your Display name and App Contact Email and click Create App button:

4

5/ After app is created, Click “Set up” button at Facebook Login from Add Products page:

5

6/ Select platform for your app, select Web platform:

platform

7/ After Select Web platform fill in your Site URL and click Save button:

siteurl

8/ After click save, make sure it is activated (live):

To make your app live, go to My Apps/YourNewCreatedApps/Settings/Basic

8

#1: Fill in your Namespace

#2: Ensure your Contact Email is correct

#3: Fill in your App Domains

#4: Fill in your Site Privacy Policy URL

#5: Fill in your Site Terms of Service URL

#6: Upload your app icon

#7: Enter yoursiteurl/social/auths/delete_app/facebook

#8: Select your app category

#9: On header of page change App Mode from Development to Live

If any of # above incorrect, your app cannot be lived.

9/ Go to App Review/Permissions and Features and switch public_profile and email to Advanced Access:

openid1

10/ How to configure your Admin Dashboard:

Go to Admin Dashboard/OpenID Connect/Facebook Login

Then:

appapi

Get #1 and #2 from fb app and copy to your Admin Dashboard/OpenID Connect/Facebook Login

openid2

#1: Your Client ID from your FB app (in your FB app/Settings/Basic)

#2: Your Client Secret from your FB app (in your FB app/Settings/Basic, the App Secret will show after pressing Show button and re-enter your FB password

#3: Copy link Return URL field: [yoursite/open_id_connects/login/] paste to Valid OAuth Redirect Url at your facebook developer page and setEmbedded Browser OAuth Login to Yes

Save Facebook Login.

openid3

*You dont need to config SDK version used in Admin Dashboard, system will be detected automatically.

*Remember to check if any space in the fields.

*Remember your site could be [https] instead of [http], they will not recognize if site was [https] and Client ID & Admin Dashboard were [http].

CONFIG GOOGLE

1/ Go to console.developers.google.com:

2/ Login your google account & create project:

createproject

#Press on Create Project.

3/ Fill in your Project’s Name:

enterappname

#1 Fill your project’s name

#2 Create

*Agree to Terms and Conditions if they’re showing up.

4/ After your project is done creating select your Project from select box and go to API & Services/Credentials of your project:

openid4

5/ Click on CREATE AREDENTIALS and choose OAuth client ID:

openid5

6/We have to configure consent screen first:

moosocial.com_wiki_lib_plugins_ckgedit_fckeditor_userfiles_image_admin_dashboard_system_admin_system_settings_gg_configure.jpg

#Press on Configure consent Screen then continue.

7/ Select External and click on CREATE button:

openid6

8/ Register at your OAuth Consent Screen :

openid7

#1 Enter App name

#2 Enter User support email

#3 Upload logo

#4 Enter your home page link

#5 Enter your privacy policy page link

#6 Enter your terms of service page link

#7 Enter your domain

#8 Enter your developer contact email

#9 Save information

Do the step 4 and step 5 again to create OAuth client ID

9/ Select Application type: Web application:

openid8

10/ Fill the client ID information:

#1 Enter the OAuth client name

#2 Enter redirect URls, this URL has format: [yoursite/open_id_connects/login]

#3 Create OAuth Client ID

openid9

11/ Review and save your Client ID and Client Secret:

openid10

Copy (1) and (2) to your setting Admin Dashboard/OpenID Connect/Google Login:

openid11

*Remember to check if any space in the fields.

*Remember your site could be [https] instead of [http], they will not recognize if site was [https] and Client ID & Admin Dashboard were [http].

* Both sides, Admin Dashboard and Client ID must be configured synchronously for the 1, 2, they must be same to each others.

CONFIG TWITTER

1. Go to https://developer.twitter.com/en/apps and login your Twitter developer account.

Note: if your account is not developer account, you will got a message request “Apply for a developer account”, please click “Apply for a developer account” and follow all steps to apply developer account.

2. At Dashboard tab, click on Create Project button:

002_social

3. At Projects & Apps tab, you must fill all your project information:

3.1 Enter Project name and click on Next button.

003_social

3.2. Select a Use case and click on Next button.

004_social

3.3. Enter Project description and click on Next button.

005_social

4. After create project successfully, you must fill all your application information:

4.1 Select your App environment and click on Next button.

006_social

4.2. Enter your App name and click on Next button.

007_social

5. After create application successfully, you will see your keys and tokens.

6. Click on App settings button.

7. At App settings page, click on Set up button:

009_social

8. You have to fill all your app settings.

8.1 App permission: select Read and write and Direct message.

010_social

8.2. Type of App: select Web App, Automated App or Bot.

011_social

8.3 App info: enter app info and click on Save button.

openid12

#1. Callback URl / Redirect URL:
enter [yoursite/open_id_connects/login]

Example: https://moosocial.com/open_id_connects/login

#2. Website URL: enter your website URL.

#3. Organization name (optional): enter your organization name.

#4. Organization URL (optional): enter your organization URL.

#5. Terms of service (optional): enter your Terms of service URL.

#6: Privacy policy (optional): enter your Privacy policy URL.

9/ Review and save your Client ID and Client Secret:

openid13

Copy (1) and (2) to your setting Admin Dashboard/OpenID Connect/Twitter Login:

openid14

CONFIG LINKEDLIN

1. Go to https://www.linkedin.com/developers/

2. Login –> Create app:

openid15

3. Complete information about your app:

openid16

#1 Enter your app name

#2 Select your company linkedlin page

#3 Enter your privacy poicy page link

#4 Upload your logo

#5 Tick on I have read and agree to these terms check box

#6 Create app

4. Verify your app:

4.1/ Go to Settings tab, click on Verify button:

openid17

4.2/ At Verify company popup, click on Generate URL to get Verification URL:

openid18

4.3/ Open Verification URL and click on Verify button:

openid19

5. After verify your app, open Products tab and click on Request access for Sign In with LinkedIn v2:openid20

6. Open Auth tab, Add redirect URL and click on Update button:

Your redirect URL has the format: [yoursite/open_id_connects/login]

openid21

7. You can view and copy your Client ID and Client Secret:

openid22

And use that Client ID and Client Secret at your setting Admin Dashboard/OpenID Connect/Linkedin Login:

openid23

 

CONFIG APPLE

To set up login with Apple, we need to fill in Client ID and Client Secret information
I will guide you through it step by step.

Step 1: Login https://developer.apple.com/account

In the Certificates, IDs & Profiles section -> Click Identifiers
https://developer.apple.com/account/resources/identifiers/list

Identifiers: These are unique strings used to identify your app, software package, and services across Apple’s platforms. Each app or service needs its own identifier to be verified and connected with features like Push Notifications or In-App Purchases.

oid_step2

Step 2: Select Services IDs and click Register an Services ID

Step 3: Select Services IDs and click Continue

Step 4: Enter Description and Identifier, click Continue

Description: You cannot use special characters such as @, &, *, “
Identifier: We recommend using a reverse-domain name style string (i.e., com.domainname.appname). It cannot contain an asterisk (*).

Step 5. Click Register button

Step 6. Click on the Identifier name you just created

 

Step 7. Enable Sign In with Apple services and click Configure

Step 8: Config Web Authentication

1. Primary App ID: Select the identifier of your application

2. Domains and Subdomains: Enter your domain. Please do not enter https

3. Return URLs: Go to the your site and open OpenId Connect menu, click on Edit Application (Apple)

oid_step8.3

There is a Return URL that you need to enter:

oid_step8.3.2

The result will look like this. Then click Next

oid_step8.4

Click Done

oid_step8.5

Click Continue

oid_step8.6

Click Save

oid_step8.7

Step 9: Create key

In Certificates, Identifiers & Profiles (CIP) by Apple, “Key” typically refers to the pairs of public and private keys used for encryption and decryption. The private key is kept secret and used for signing applications, ensuring source code integrity. The public key, shared openly, verifies digital signatures. These keys are essential for certificate management and developer/app identity authentication across Apple’s platforms.

Select Keys menu and click on + button

oid_step9

Register key

oid_step9.1

1. Enter name for your key

2. Enable Sign in with Apple

3. Click on Configure button

Select your Primary App ID and click Save

oid_step9.2

Click Continue

oid_step9.3

Click Register

oid_step9.4

Click Download button to download the key.
Notice: Apple only allows you to download it once.

After download click done.

oid_step10

Step 10: Go to https://travel.moosocial.com/AppleSignIn to get Client Secret

oid_step11.1

1. Client ID:  It is the Identifier of Services ID

oid_step11.2

2. Team ID:

oid_step11.3

3. Key ID: Go to https://developer.apple.com/account/resources/authkeys/list
and select the key you just created

oid_step11.4

You will see your Key ID

oid_step11.5

4. Certificate Path: It is the file you downloaded when created the key

After fill all fields and click Generate button, you can get Client Secret

oid_step11.6

Step 11. Go to the your site and open OpenId Connect menu, click on Edit Application (Apple).

Enter Client ID and Client Secret you just get. After saving, users can login your site by using Apple account.

oid_step12

How to remove mooSocial version and branding in Admin Panel

When the Site Admin logs in to the Admin Dashboard, they will see the version and branding of mooSocial in Admin Panel.

1

Follow the steps below to learn how to remove the version and branding.

  • Access Admin Dashboard => System Settings => General

2

  [1] Uncheck the “Show all mooSocial branding” checkbox to remove mooSocial branding.

  [2] Check on the “Hide mooSocial version” checkbox if you want to hide the mooSocial version.

=> Click on Save Settings button.

  • Go to Admin Home page: The mooSocial version and branding have been removed.

3

Hopefully, this tutorial was helpful for you.