Skip to content

Commit

Permalink
Merge pull request #56 from capacitor-community/appcenter-sdk-upgrade
Browse files Browse the repository at this point in the history
appcenter sdk upgrade across all plugins
  • Loading branch information
johnborges authored Apr 12, 2022
2 parents 8cfa4ff + 9941980 commit b1d7cd8
Show file tree
Hide file tree
Showing 36 changed files with 296 additions and 106 deletions.
2 changes: 1 addition & 1 deletion AppCenterCapacitorShared.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '12.0'
s.swift_version = '5.1'
s.source_files = 'AppCenterCapacitorShared/ios/AppCenterCapacitorShared/*.swift'
s.dependency 'AppCenter/Core', ' ~> 4.4.0'
s.dependency 'AppCenter/Core', '~> 4.4.0'
s.static_framework = true
end
6 changes: 6 additions & 0 deletions appcenter-analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## [1.1.0](https://github.com/capacitor-community/appcenter-sdk-capacitor/compare/@capacitor-community/[email protected]...@capacitor-community/[email protected])

### Features

* **ios/android**: Add `Analytics.enableManualSessionTracker` and `Analytics.startSession`

## [1.0.0](https://github.com/capacitor-community/appcenter-sdk-capacitor/compare/@capacitor-community/[email protected]...@capacitor-community/[email protected])

### Chore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Pod::Spec.new do |s|
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
s.ios.deployment_target = '12.0'
s.dependency 'Capacitor'
s.dependency 'AppCenterCapacitorShared', '~> 1.0.0'
s.dependency 'AppCenter/Analytics', '4.3.0'
s.dependency 'AppCenterCapacitorShared', '~> 2.0'
s.dependency 'AppCenter/Analytics', '~> 4.4.0'
s.static_framework = true
s.swift_version = '5.1'
end
28 changes: 28 additions & 0 deletions appcenter-analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Once you add App Center Analytics to your app and the SDK is started, it will au
* [`pause()`](#pause)
* [`resume()`](#resume)
* [`trackEvent(...)`](#trackevent)
* [`enableManualSessionTracker()`](#enablemanualsessiontracker)
* [`startSession()`](#startsession)
* [Interfaces](#interfaces)

</docgen-index>
Expand Down Expand Up @@ -121,6 +123,32 @@ Track an event with optional custom properties to know what's happening in your
--------------------


### enableManualSessionTracker()

```typescript
enableManualSessionTracker() => Promise<void>
```

Enable manual session tracker.

**Since:** 2.0.0

--------------------


### startSession()

```typescript
startSession() => Promise<void>
```

Start a new session if manual session tracker is enabled, otherwise do nothing.

**Since:** 2.0.0

--------------------


### Interfaces


Expand Down
4 changes: 2 additions & 2 deletions appcenter-analytics/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ repositories {


dependencies {
api 'com.microsoft.appcenter:appcenter-analytics:4.2.0'
api 'com.microsoft.appcenter.reactnative:appcenter-react-native:4.2.0' // change to own version
api 'com.microsoft.appcenter:appcenter-analytics:4.4.+'
api 'com.microsoft.appcenter.reactnative:appcenter-react-native:4.4.+' // change to own version
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':capacitor-android')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,12 @@ public void enable(boolean enable) {
public boolean isEnabled() {
return Analytics.isEnabled().get();
}

public void enableManualSessionTracker() {
Analytics.enableManualSessionTracker();
}

public void startSession() {
Analytics.startSession();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ public void trackEvent(PluginCall call) {
implementation.trackEvent(name, properties, flag);
}

@PluginMethod(returnType = PluginMethod.RETURN_NONE)
public void enableManualSessionTracker(PluginCall call) {
implementation.enableManualSessionTracker();
call.resolve();
}

@PluginMethod(returnType = PluginMethod.RETURN_NONE)
public void startSession(PluginCall call) {
implementation.startSession();
call.resolve();
}

private static Map<String, String> mapFromJSON(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
Expand Down
8 changes: 8 additions & 0 deletions appcenter-analytics/ios/Plugin/AppCenterAnalyticsBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,12 @@ import AppCenterAnalytics
return Analytics.enabled
}

public func enableManualSessionTracker() {
Analytics.enableManualSessionTracker()
}

public func startSession() {
Analytics.startSession()
}

}
2 changes: 2 additions & 0 deletions appcenter-analytics/ios/Plugin/AppCenterAnalyticsPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
CAP_PLUGIN_METHOD(pause, CAPPluginReturnNone);
CAP_PLUGIN_METHOD(resume, CAPPluginReturnNone);
CAP_PLUGIN_METHOD(trackEvent, CAPPluginReturnNone);
CAP_PLUGIN_METHOD(enableManualSessionTracker, CAPPluginReturnNone);
CAP_PLUGIN_METHOD(startSession, CAPPluginReturnNone);
)
10 changes: 10 additions & 0 deletions appcenter-analytics/ios/Plugin/AppCenterAnalyticsPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,14 @@ public class AnalyticsPlugin: CAPPlugin {

call.resolve()
}

@objc func enableManualSessionTracker(_ call: CAPPluginCall) {
implementation.enableManualSessionTracker()
call.resolve()
}

@objc func startSession(_ call: CAPPluginCall) {
implementation.startSession()
call.resolve()
}
}
4 changes: 2 additions & 2 deletions appcenter-analytics/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ end

target 'Plugin' do
capacitor_pods
pod 'AppCenterCapacitorShared', '~> 1.0.0'
pod 'AppCenter/Analytics', '4.3.0'
pod 'AppCenterCapacitorShared', '~> 2.0'
pod 'AppCenter/Analytics', '~> 4.4.0'
end

target 'PluginTests' do
Expand Down
2 changes: 1 addition & 1 deletion appcenter-analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@capacitor-community/appcenter-analytics",
"version": "1.0.0",
"version": "1.1.0",
"description": "Capacitor plugin for AppCenter Analytics",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
Expand Down
14 changes: 14 additions & 0 deletions appcenter-analytics/src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,18 @@ export interface AnalyticsPlugin {
* @since 0.1.0
*/
trackEvent(options: AnalyticsEvent): Promise<void>;

/**
* Enable manual session tracker. Call this method before Analytics starts.
* @returns {Promise<void>}
* @since 2.0.0
*/
enableManualSessionTracker(): Promise<void>;

/**
* Start a new session if manual session tracker is enabled, otherwise do nothing.
* @returns {Promise<void>}
* @since 2.0.0
*/
startSession(): Promise<void>;
}
6 changes: 6 additions & 0 deletions appcenter-analytics/src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import { WebPlugin } from '@capacitor/core';
import type { AnalyticsPlugin } from './definitions';

export class AnalyticsWeb extends WebPlugin implements AnalyticsPlugin {
enableManualSessionTracker(): Promise<void> {
throw this.unimplemented('Not supported on web.');
}
startSession(): Promise<void> {
throw this.unimplemented('Not supported on web.');
}
setEnabled(): Promise<void> {
throw this.unimplemented('Not supported on web.');
}
Expand Down
6 changes: 6 additions & 0 deletions appcenter-crashes/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [1.0.1](https://github.com/capacitor-community/appcenter-sdk-capacitor/compare/@capacitor-community/[email protected]...@capacitor-community/[email protected])

### Chore

* updating sdk to latest 4.4.x

## [1.0.1](https://github.com/capacitor-community/appcenter-sdk-capacitor/compare/@capacitor-community/[email protected]...@capacitor-community/[email protected])

### Fixes

* **android**: change `setEnable` to `setEnabled`
Expand Down
4 changes: 2 additions & 2 deletions appcenter-crashes/CapacitorCommunityAppcenterCrashes.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ Pod::Spec.new do |s|
s.swift_version = '5.1'
s.static_framework = true
s.dependency 'Capacitor'
s.dependency 'AppCenterCapacitorShared', '~> 1.0.0'
s.dependency 'AppCenter/Crashes', '4.3.0'
s.dependency 'AppCenterCapacitorShared', '~> 2.0'
s.dependency 'AppCenter/Crashes', '~> 4.4.0'
end
4 changes: 2 additions & 2 deletions appcenter-crashes/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ repositories {


dependencies {
api 'com.microsoft.appcenter:appcenter-crashes:4.3.1'
api 'com.microsoft.appcenter.reactnative:appcenter-react-native:4.2.0' // change to own version
api 'com.microsoft.appcenter:appcenter-crashes:4.4.+'
api 'com.microsoft.appcenter.reactnative:appcenter-react-native:4.4.+' // change to own version
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':capacitor-android')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
Expand Down
4 changes: 2 additions & 2 deletions appcenter-crashes/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ end

target 'Plugin' do
capacitor_pods
pod 'AppCenterCapacitorShared', '~> 1.0.0'
pod 'AppCenter/Crashes', '4.3.0'
pod 'AppCenterCapacitorShared', '~> 2.0'
pod 'AppCenter/Crashes', ' ~> 4.4.0'
end

target 'PluginTests' do
Expand Down
2 changes: 1 addition & 1 deletion appcenter-crashes/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@capacitor-community/appcenter-crashes",
"version": "1.0.1",
"version": "1.0.2",
"description": "Capacitor plugin for Microsoft's App Center Crashes",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
Expand Down
10 changes: 10 additions & 0 deletions appcenter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

## [2.0.0](https://github.com/capacitor-community/appcenter-sdk-capacitor/compare/@capacitor-community/[email protected]...@capacitor-community/[email protected])

### Breaking Changes

* **ios/android** Remove `AppCenter.setCustomProperties` API.

### Features

* **android**: Add `AppCenter.setCountryCode` API.

## [1.0.0](https://github.com/capacitor-community/appcenter-sdk-capacitor/compare/@capacitor-community/[email protected]...@capacitor-community/[email protected])

### Chores
Expand Down
2 changes: 1 addition & 1 deletion appcenter/CapacitorCommunityAppcenter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
s.ios.deployment_target = '12.0'
s.dependency 'Capacitor'
s.dependency 'AppCenterCapacitorShared', '~> 1.0.0'
s.dependency 'AppCenterCapacitorShared', '~> 2.0'
s.static_framework = true
s.swift_version = '5.1'
end
22 changes: 21 additions & 1 deletion appcenter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const appCenterInfo = async () => {
* [`setLogLevel(...)`](#setloglevel)
* [`setNetworkRequestsAllowed(...)`](#setnetworkrequestsallowed)
* [`isNetworkRequestsAllowed()`](#isnetworkrequestsallowed)
* [`setCountryCode(...)`](#setcountrycode)
* [Enums](#enums)

</docgen-index>
Expand Down Expand Up @@ -175,7 +176,7 @@ For instance, you can use custom properties to segment your users, and then send

**Returns:** <code>any</code>

**Since:** 0.2.0
**Since:** 2.0.0

--------------------

Expand Down Expand Up @@ -250,6 +251,25 @@ Check whether sending data in the App Center SDK is allowed or not.
--------------------


### setCountryCode(...)

```typescript
setCountryCode(options: { countryCode: string; }) => any
```

Set the two-letter ISO country code. Android only

| Param | Type | Description |
| ------------- | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **`options`** | <code>{ countryCode: string; }</code> | the two-letter ISO country code. See &lt;code&gt;https://www.iso.org/obp/ui/#search&lt;/code&gt; for more information. |

**Returns:** <code>any</code>

**Since:** 2.0.0

--------------------


### Enums


Expand Down
2 changes: 1 addition & 1 deletion appcenter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ repositories {

dependencies {
//api project(':AppCenterReactNativeShared') // For testing with TestApp
api 'com.microsoft.appcenter.reactnative:appcenter-react-native:4.2.0' // change to own version
api 'com.microsoft.appcenter.reactnative:appcenter-react-native:4.4.+' // change to own version
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':capacitor-android')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
Expand Down
Loading

0 comments on commit b1d7cd8

Please sign in to comment.