Git Product home page Git Product logo

capacitor-ios-app-tracking's Introduction

Hi πŸ‘‹πŸ»,

I'm Mig Tam, I'm a full-stack developer πŸ‘¨πŸ»β€πŸ’» who is passionate about coding and sharing my work.

  • πŸ“– I’m currently learning some Python
  • πŸ’ͺ🏻 I’m looking to collaborate on any React | Nodejs | Ionic | Capacitor | Typesscript project.
  • ⚑ Languages: Javascript, Typescript and Swift.
  • ☒︎ Technologies: React, Ionic, React Native, Node.

capacitor-ios-app-tracking's People

Contributors

marvinwee avatar migtam628 avatar migtamrod avatar rpanadero avatar

Stargazers

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

Watchers

 avatar  avatar

capacitor-ios-app-tracking's Issues

Release updated package to npm

Hi @migtam628. Huge thanks for the package. Would it be possible to publish the newer code into npm. Having issues with the Android build that was fixed on #1

Thanks in advance!

Problem with show confirm dialog "Asking Permission to Track" for iOS 16.1

Bug Report

The plugin worked good with iOS version < 16.0, bud then I install my app on device with iOS 16.1, the confirm dialog "Asking Permission to Track" did not show.

Plugin version:
[x] 2.0.3

Capacitor version:
[x] 4.2.0

Current behavior:
Confirm dialog "Asking Permission to Track" did not show.

Expected behavior:
Confirm dialog"Asking Permission to Track" will show.
image

Related code:
I have the code as shown (readme).
https://github.com/migtam628/capacitor-ios-app-tracking/blob/master/README.md

Other information:
Response from Apple review:

Guideline 2.1 - Information Needed

We're looking forward to completing our review, but we need more information to continue. Your app uses the AppTrackingTransparency framework, but we are unable to locate the App Tracking Transparency permission request when reviewed on iOS 16.1.

Next Steps

Please explain where we can find the App Tracking Transparency permission request in your app. The request should appear before any data is collected that could be used to track the user.

If you've implemented App Tracking Transparency but the permission request is not appearing on devices running the latest OS, please review the available documentation and confirm App Tracking Transparency has been correctly implemented.

If your app does not track users, update your app privacy information in App Store Connect to not declare tracking. You must have the Account Holder or Admin role to update app privacy information.

Resources

Ionic info:

Ionic:

   Ionic CLI                     : 6.20.1 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 6.2.7
   @angular-devkit/build-angular : 14.2.2
   @angular-devkit/schematics    : 14.2.2
   @angular/cli                  : 14.2.2
   @ionic/angular-toolkit        : 6.1.0

Capacitor:

   Capacitor CLI      : 4.2.0
   @capacitor/android : 4.2.0
   @capacitor/core    : 4.2.0
   @capacitor/ios     : 4.2.0

Utility:

   cordova-res                          : 0.15.4
   native-run (update available: 1.7.1) : 1.6.0

System:

   NodeJS : v16.16.0 (/usr/local/bin/node)
   npm    : 8.17.0
   OS     : macOS Monterey

iOS build fails

Hi,

Thanks for this package. I am using it in an Ionic Capacitor project.
I recently tried to upgrade from capacitor 2.x.x. to capacitor 3.x.x. Therefore I updated this package to version 1.0.3.

This package stopped working now. When opening the capacitor project in xcode, it shows the following error:

image

When I adjust the conditions back to
if #available(iOS 14.0, *)
the package works again as expected.

iOS 15.0 should not be added to this condition, because the wildcard ('*') already checks for any version above the iOS 14.0.

Thanks and regards,
Fer

requestPermission resolves immediately with "unrequested"

Hello there!
I have a problem with an Ionic 5 Angular App.

Problem:
Every time when I request the permission, the promise resolves immediately and returns "unrequested"

Expected Behavior:
Only resolve if the user has taken action and return the correct status.

This is a stripped down version of my implementation (in typescript):

import { Response } from 'capacitor-ios-app-tracking';
const { Device, IOSAppTracking } = Plugins;

@Component({
  selector: 'app-root',
  templateUrl: 'app.component.html',
  styleUrls: ['app.component.scss']
})
export class AppComponent implements AfterViewInit {
// ... code here
 constructor(private platform: Platform) {
  this.platform.ready().then({
    // Platform is ready. Do stuff!
      this.getTrackingPermission().then(res => {
         // User has allowed tracking.
        // res.status is always "unrequested" here
     }).catch(err => {
        // User has denied tracking.
    });
  });
}
  /**
   * Requests tracking permission
   */
  getTrackingPermission(): Promise<Response> {
    return new Promise((resolve, reject) => {
      IOSAppTracking.getTrackingStatus().then((res: Response) => {
        console.log('Tracking Status: ' + res.status);
        if (res.status === 'unrequested') {
          IOSAppTracking.requestPermission().then((response: Response) => {
            console.log('Tracking Status: ' + response.status);
            resolve(response);
          });
        }
        if (res.status === 'authorized' || res.status === 'restricted') { resolve(res); }
        if (res.status === 'denied') { reject('Tracking permission denied'); }
      });
    });
  }
// ... more code
}

Am I missing something?
Thanks for this plugin, btw. We really need this for our customer apps.

Incorrect README docs IOSAppTrackingResponse interface

The documentation needs to be updated as the "IOSAppTrackingResponse" incorrectly states the response of "code" when in fact the response key is "value".

Response returned from the API is as follows:
{value: string, status: IOSAppTrackingStatus}

Capacitor 4 support

Any chance this plugin could be updated to support Capacitor 4?

Targeting Android 12 is a requirement for the Google Play store in November (and for new apps since August) so having a Capacitor 4 compatible version is important. There is a tool to help out with adding Capacitor 4 support for a plugin: https://github.com/rdlabo-team/capacitor-plugin-to-v4.

Issues with Android build

Hi @migtam628, thanks in advance for the package πŸ‘

When I try to build the Android version, I'm getting the following error:

Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve project :capacitor-ios-app-tracking.
     Required by:
         project :app
      > No matching configuration of project :capacitor-ios-app-tracking was found. The consumer was configured to find an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' but:
          - None of the consumable configurations have attributes.

Any ideas on how to solve this?

Thanks!

ios 15

Guess this tracing is only for iOS 14. Can it be also made available higher than 14? Got my app rejected in the Appstore on iOS 15.

plugin is not implemented on ios

I am getting the error "plugin is not implemented on iOS" with latest Xcode and Capacitor. I installed the plugin and ran cap sync ios. It looks also a bit weird how the plugin is implemented. It looks like its never initiated.

Error: code "unimplemented"

Hi guys,

I'm trying to use the package in an Ionic project with React and I am getting this error when it calls the requestPermission method.

Error unimplemented

I am out of ideas of what is causing this.

Capacitor says that:

Unimplemented

Use this error to indicate that a method can’t be implemented for iOS.

@objc override func methodThatRequiresAndroid(_ call: CAPPluginCall) {
    call.unimplemented("Not implemented on iOS.")
}

https://capacitorjs.com/docs/plugins/ios#unimplemented

It seems weird to me.

Any help?

Config

Ionic:
Ionic CLI : 6.16.3 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 5.6.12

Capacitor:
Capacitor CLI : 3.1.2
@capacitor/android : 3.1.2
@capacitor/core : 3.1.2
@capacitor/ios : 3.1.2

Utility:
cordova-res : 0.15.3
native-run : 1.4.0

System:
NodeJS : v16.4.0 (/usr/local/bin/node)
npm : 7.20.1
OS : macOS Big Sur

Support for Capacitor 2.x

Hello,

Since the upgrade to Capacitor 3, it seems the plugin doesn't work with previous releases of Capacitor as the plugin requires Capacitor 3 as peer dependency. I'm currently having apps in production using Capacitor 2.1.0 without the ability to upgrade them to Capacitor 3. I now need to implement the new App Tracking Transparency from Apple.

Would it be possible to restore Capacitor 2 compatibility ?

Thanks

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.