|
| 1 | +/* |
| 2 | + * Copyright (c) 2026-present, salesforce.com, inc. |
| 3 | + * All rights reserved. |
| 4 | + * Redistribution and use in source and binary forms, with or without modification, are permitted provided |
| 5 | + * that the following conditions are met: |
| 6 | + * - Redistributions of source code must retain the above copyright notice, this list of conditions and the |
| 7 | + * following disclaimer. |
| 8 | + * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and |
| 9 | + * the following disclaimer in the documentation and/or other materials provided with the distribution. |
| 10 | + * - Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or |
| 11 | + * promote products derived from this software without specific prior written permission. |
| 12 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED |
| 13 | + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
| 14 | + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
| 15 | + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 16 | + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 17 | + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR |
| 18 | + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 19 | + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 20 | + */ |
| 21 | +package com.salesforce.androidsdk.phonegap.app |
| 22 | + |
| 23 | +import android.app.Application |
| 24 | +import com.salesforce.androidsdk.phonegap.app.SalesforceHybridSDKManager |
| 25 | + |
| 26 | +/** |
| 27 | + * Application class for hybrid apps. |
| 28 | + * Customize SDK initialization here. |
| 29 | + */ |
| 30 | +class MainApplication : Application() { |
| 31 | + |
| 32 | + override fun onCreate() { |
| 33 | + super.onCreate() |
| 34 | + SalesforceHybridSDKManager.initHybrid(applicationContext) |
| 35 | + |
| 36 | + /* |
| 37 | + * Uncomment the following line to enable IDP login flow. This will allow the user to |
| 38 | + * either authenticate using the current app or use the designated IDP app for login. |
| 39 | + * Replace 'com.salesforce.samples.salesforceandroididptemplateapp' with the package name |
| 40 | + * of the IDP app meant to be used. |
| 41 | + */ |
| 42 | + // SalesforceHybridSDKManager.getInstance().idpAppPackageName = "com.salesforce.samples.salesforceandroididptemplateapp" |
| 43 | + |
| 44 | + /* |
| 45 | + * Uncomment the following line to enable push notifications in this app. |
| 46 | + * Replace 'pnInterface' with your implementation of 'PushNotificationInterface'. |
| 47 | + * Add your Firebase 'google-services.json' file to the 'app' folder of your project. |
| 48 | + */ |
| 49 | + // SalesforceHybridSDKManager.getInstance().pushNotificationReceiver = pnInterface |
| 50 | + } |
| 51 | +} |
0 commit comments