Skip to content

Commit

Permalink
Updated for Android 13 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Mote committed Sep 29, 2022
1 parent c540d99 commit 9b6fd7d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
.project
.settings
.classpath
.jekyll*
_site/

# Ignore firebase file so we don't accidentally add it to git
google-services.json
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ apply plugin: 'androidx.navigation.safeargs'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 29
compileSdkVersion 33

defaultConfig {
applicationId "com.salesforce.marketingcloud.learningapp"
minSdkVersion 21
targetSdkVersion 29
targetSdkVersion 33
versionCode 1
versionName "1.0"

Expand Down
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
android:supportsRtl="true"
android:theme="@style/MyTheme.DayNight"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".MainActivity">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import com.salesforce.marketingcloud.messages.iam.InAppMessage
import com.salesforce.marketingcloud.messages.iam.InAppMessageManager
import com.salesforce.marketingcloud.sfmcsdk.*

const val LOG_TAG = "MCSDK"
const val LOG_TAG = "~#MCLearningApp"

abstract class BaseLearningApplication : Application(), UrlHandler {

Expand All @@ -51,8 +51,17 @@ abstract class BaseLearningApplication : Application(), UrlHandler {
super.onCreate()

if (BuildConfig.DEBUG) {
// Only log for DEBUG builds
MarketingCloudSdk.setLogLevel(MCLogListener.VERBOSE)
MarketingCloudSdk.setLogListener(MCLogListener.AndroidLogListener())
SFMCSdk.requestSdk { sdk ->
sdk.mp { push ->
push.registrationManager.registerForRegistrationEvents {
// Log the registration on successful sends to the MC
Log.i(LOG_TAG, "Registration: $it")
}
}
}
}

// You MUST initialize the SDK in your Application's onCreate to ensure correct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class InboxViewer : Fragment() {
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
webView = WebView(context)
webView = WebView(requireContext())
webView.settings.javaScriptEnabled = true
return webView
}
Expand Down

0 comments on commit 9b6fd7d

Please sign in to comment.