Coder Social home page Coder Social logo

capacitor-community / appcenter-sdk-capacitor Goto Github PK

View Code? Open in Web Editor NEW
35.0 4.0 5.0 31.88 MB

Capacitor Plugin for Microsoft's Visual Studio App Center SDK.

Home Page: https://docs.microsoft.com/en-us/appcenter/

License: MIT License

Swift 27.19% Ruby 4.80% TypeScript 36.23% CSS 1.10% HTML 1.05% Java 25.50% Objective-C 2.96% JavaScript 1.17%
capacitor capacitor-plugin appcenter visual-studio-app-center

appcenter-sdk-capacitor's Introduction

App Center SDK for Capacitor

GitHub Workflow Status lerna

App Center is mission control for mobile apps. Get faster release cycles, higher-quality apps, and the insights to build what users want.

Plugins

The Capacitor App Center SDK consists of a several plugins so you can use any or all of the supported App Center services. This SDK uses a modular approach, where you just add the modules for App Center services that you want to use. appcenter-analytics and appcenter-crashes make sense to add to almost every app, as they provide value with no additional setup required. appcenter provides general purpose App Center APIs, useful for multiple services.

Package Source Version Downloads
@capacitor-community/appcenter ./appcenter npm badge npm badge
@capacitor-community/appcenter-analytics ./appcenter-analytics npm badge npm badge
@capacitor-community/appcenter-crashes ./appcenter-crashes npm badge npm badge

๐Ÿ“ฑ Example Mobile App

You can get familiar with SDK quickly by cloning this repository and running the sample app in example directory. For further instructions please refer to example's README

1. ๐Ÿ“ฆ Installation

Add the App Center plugin(s) that fit your needs directly from the CLI:

npm i @capacitor-community/appcenter @capacitor-community/appcenter-analytics @capacitor-community/appcenter-crashes --save-exact
npx cap sync

2. ๐Ÿ›  Configure the SDK

You must configure the project with your App Center project app secret before you can use the App Center SDK in your Capacitor project. There are other values that can also be added, but they are optional.

Notice that it's likely that Android and iOS platforms will be associated with different applications on App Center portal so you would need to add the APP_SECRET twice - one for Android and another for iOS.

iOS

Create a new file with the name AppCenter-Config.plist with the following content and replace {APP_SECRET_VALUE} with your app secret value. Don't forget to add this file to the Xcode project (right-click the app in Xcode and click Add files to ...).

Example:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>AppSecret</key>
    <string>{APP_SECRET_VALUE}</string>
    <!-- below are optional -->
    <key>LogLevel</key>
    <integer>2</integer>
    <key>AnalyticsEnableInJs</key>
    <false/>
    <key>AnalyticsTransmissionInterval</key>
    <integer>3</integer>
    <key>CrashesEnableInJs</key>
    <false/>
    <key>CrashesAlwaysSend</key>
    <false/>
</dict>
</plist>

Android

Create a new file with the name appcenter-config.json in android/app/src/main/assets/ with the following content and replace {APP_SECRET_VALUE} with your app secret value.

{
    "app_secret": "{APP_SECRET_VALUE}",
    "start_automatically": true
}

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


John Borges

๐Ÿ’ป

Hrafnkell Baldursson

๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

appcenter-sdk-capacitor's People

Contributors

allcontributors[bot] avatar hrafnkellb-advania avatar hrafnkellbaldurs avatar johnborges avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

appcenter-sdk-capacitor's Issues

Not able to see Crash report on MS-App Center.

Bug Report

Plugin(s)

npm i @capacitor-community/appcenter @capacitor-community/appcenter-analytics @capacitor-community/appcenter-crashes --save-exact
npx cap sync

Capacitor Version

๐Ÿ’Š Capacitor Doctor ๐Ÿ’Š

Latest Dependencies:

@capacitor/cli: 3.6.0
@capacitor/core: 3.6.0
@capacitor/android: 3.6.0
@capacitor/ios: 3.6.0

Installed Dependencies:

@capacitor/cli: 3.6.0
@capacitor/core: 3.6.0
@capacitor/android: 3.6.0
@capacitor/ios: 3.6.0

[success] iOS looking great! ๐Ÿ‘Œ
[success] Android looking great! ๐Ÿ‘Œ
npm notice
npm notice New minor version of npm available! 8.5.5 -> 8.13.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.13.2
npm notice Run npm install -g [email protected] to update!
npm notice

Platform(s)

Android, iOS

Current Behavior

When added Crashes.generateTestCrash() in app-component.ts file Not able to generate the test crash the app in both Android and iOS platforms and not able to see report on MS-App Center

Expected Behavior

Should be able to crash the app and see logs on MS-App Center.

AppCenter distribute

Feature Request

Plugin

AppCenter-sdk-Capacitor distribute

Description

App Center Distribute: App Center Distribute will let your users install a new version of the app when you distribute it via the App Center. With a new version of the app available, the SDK will present an update dialog to the users to either download or postpone the new version. Once they choose to update, the SDK will start to update your application.

Platform(s)

  • Android
  • iOS

Preferred Solution

Ideally it shuld work like Crash and Analytics, installing the plugin @capacitor-community/appcenter-distribute we should be able to leverage the Appcenter sdk

Alternatives

None

Additional Context

https://github.com/microsoft/appcenter-sdk-android
https://learn.microsoft.com/en-us/appcenter/sdk/#app-center-distribute

Plugin build fails when AppCenter SDK not manually added

Describe the bug
Each plugin subproject fails to build with the AppCenter dependency specified only through Cocoapods. The temporary solution has been to manually add AppCenter.xcframework to each Xcode project.

To Reproduce
Steps to reproduce the behavior:

  1. Open Xcode Workspace for any given plugin.
  2. On Plugin target, remove AppCenter.xcframework under "General > Frameworks and Libraries"
  3. Run npm run verify:ios
  4. See error similar to
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_CrashesPlugin", referenced from:
      __OBJC_$_CATEGORY_CrashesPlugin_$_CAPPluginCategory in AppCenterCrashesPlugin-d8384b74d5b7b99f0656c39321e02918db9e7b6099e5af8d1471783095153663.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Expected behavior
Following the Cocoapods install instruction, I would think there wouldn't be any need for manually adding this framework since its handled by Cocoapods.

how the code push works with capacitor?

Feature Request

there is not enough information how to use code push or if it's supported with the capacitor. only cordova and react native is available in the documentation

Description

the only reason we are considering the appcenter over firebase is code push, if not the same functionality is available for crash and analytics with more built-in features like admob impression in firebase, but sadly there isn't enough documentation about codepush and how to use it with capacitor (we are using angular as I noticed most examples are in react)

Platform(s)

android/ios

Preferred Solution

better documentation, angular example

Alternatives

firebase

Additional Context

@capacitor-community/[email protected] on Android has wrong plugin method name for "Crashes.setEnabled"

Bug Report

Plugin(s)

@capacitor-community/[email protected]

Platform(s)

Android

Current Behavior

When calling Crashes.setEnabled on Android, an error is always thrown saying that "Crashes.setEnabled()" is not implemented on android. This is because the plugin method name is actually wrong in the android plugin implementation.

Expected Behavior

Crashes.setEnabled should not produce an error since it is implemented on android

Other Technical Details

Please see the file where the bug is here https://github.com/capacitor-community/appcenter-sdk-capacitor/blob/%40capacitor-community/appcenter-crashes%401.0.0/appcenter-crashes/android/src/main/java/com/getcapacitor/plugin/appcenter/crashes/CrashesPlugin.java

@PluginMethod(returnType = PluginMethod.RETURN_NONE)
  public void setEnable(PluginCall call) {
      Boolean enable = call.getBoolean("enable", false);
      if (enable == null) {
          enable = false;
      }
      implementation.enable(enable);
      call.resolve();
  }

AppCenterCapacitorShared 0.3.5 not installable

Bug Report

Plugin(s)

@capacitor-community/[email protected]
@capacitor-community/[email protected]

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 3.3.2
  @capacitor/core: 3.3.2
  @capacitor/android: 3.3.2
  @capacitor/ios: 3.3.2

Installed Dependencies:

  @capacitor/core: 3.2.2
  @capacitor/cli: 3.2.2
  @capacitor/android: 3.2.2
  @capacitor/ios: 3.2.2

Platform(s)

MacOS

Current Behavior

When pod install is run in a capacitor app that's depending on
@capacitor-community/[email protected] or @capacitor-community/[email protected]
this error occurs

[error] Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "AppCenterCapacitorShared":
        In Podfile:
        CapacitorCommunityAppcenterAnalytics (from
        ../../../../../node_modules/@capacitor-community/appcenter-analytics) was resolved to 0.3.3, which depends on
        AppCenterCapacitorShared (~> 0.3.5)
        
        None of your spec sources contain a spec satisfying the dependency: AppCenterCapacitorShared (~> 0.3.5).
        
        You have either:
        * out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
        * mistyped the name or version.
        * not added the source repo that hosts the Podspec to your Podfile.

Expected Behavior

Expected the pods to install without errors

Code Reproduction

Other Technical Details

Additional Context

I tried reverting to @capacitor-community/[email protected] and
@capacitor-community/[email protected] which worked.
Those versions depend on AppCenterCapacitorShared version 0.3.2, not 0.3.5

Has AppCenterCapacitorShared version 0.3.5 been published yet?

Plugins causes parts host app to reload

Description
Having @capacitor-community/appcenter loaded into the app causes parts of the <ion-app> to reload.

To Reproduce
Steps to reproduce the behavior:

  1. Run example app
  2. Open Console
  3. See multiple component lifecycle methods fired from router to individual page components.

Expected behavior
Lifecycle events such as componentDidLoad should only fire once. Unless specifically removed from DOM.

feat: Support for crashes listener and user confirmation

Feature Request

Plugin

appcenter-crashes

Description

Add support for the following APIs:

notifyUserConfirmation(userConfirmation: UserConfirmation): Promise<void>;
setListener(crashesListener: CrashesListener): Promise<void>;

Platform(s)

iOS, Android

Cannot track event

Bug Report

Plugin(s)

"@capacitor-community/appcenter": "^4.0.0"
"@capacitor-community/appcenter-analytics": "^4.0.0"

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 5.3.0
  @capacitor/core: 5.3.0
  @capacitor/android: 5.3.0
  @capacitor/ios: 5.3.0

Installed Dependencies:

  @capacitor/cli: 4.8.1
  @capacitor/core: 5.2.2
  @capacitor/android: 5.2.2
  @capacitor/ios: 5.2.2

[success] Android looking great! ๐Ÿ‘Œ

Platform(s)

Android

Current Behavior

I'm trying to send messages, but nothing happens. At the same time, I can see that a new user has been added to the AppCenter.

Expected Behavior

Events are sent

Code Reproduction

      Analytics.startSession();
      Analytics.trackEvent({
        properties: additionalInfo,
        name: message,
      })
        .then((result) => {
          console.log({ result });
          Analytics.resume()
            .then((result) => console.log({ result }))
            .catch(console.error);
        })
        .catch(console.error);

image

Other Technical Details

Additional Context

AppCenterCrashes podspec file targeting the wrong iOS deployment target

Bug Report

The podsepc file CapacitorCommunityAppcenterCrashes.podspec modified in #64 is targeting the wrong iOS deployment target.

This causes a build error when using this plugin in a Capacitor V4 project as it has a minimum deployment target of iOS 13.

The entry in the podspec file is as follows:
s.ios.deployment_target = '12.0'

The entry in the podspec file should be:
s.ios.deployment_target = '13.0'

Plugin(s)

@capacitor-community/appcenter-crashes v3.0.0

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 4.3.0
  @capacitor/core: 4.3.0
  @capacitor/android: 4.3.0
  @capacitor/ios: 4.3.0

Installed Dependencies:

  @capacitor/cli: 4.2.0
  @capacitor/ios: 4.2.0
  @capacitor/core: 4.2.0
  @capacitor/android: 4.2.0

Platform(s)

iOS

feat(example): add header toolbar to Error Report modal

Feature Request

Plugin

example

Description

The Error Report modal in the example app is currently not dismissible so its impossible to navigate to other parts of the app. It should have a way to close.

Platform(s)

iOS

Preferred Solution

Add a <ion-header> with a toolbar and make the modal dismissible. Either via a swipe or close button.

support appcenter-sdk-android 4.4.1

Feature Request

Plugin

@capacitor-community/appcenter
@capacitor-community/appcenter-analytics
@capacitor-community/appcenter-crashes

Description

Shared lib and all plugins should use the latest android sdk.

Additional Context

This update will include some breaking changes. AppCenter.setCustomProperties is being removed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.