• Getting Started
    • Mobile Integration (Android/IOS)
      Enterprise Solutions
      Retail Solutions
      Accept Payments
      Process Payments
      Disbursals
      API References
      Testing
      Refunds
      Guides
      Other Processes
      Mini Program Platform
        Website Integration

      paytmRequestPermission JS API

      Use Case


      On Android, this parameter can be a comma separated value, e.g., "camera, record_audio, contacts". But on iOS, only one value can be specified. Follwing things can be passed in permission in following cases -

      iOS :

      camera, video, microphone, contacts, calendar, reminder, photos, location, speech,

      Android :

      camera, record_audio, read_phone_numbers, contacts, calendar, body_sensors, storage, location, get_accounts, read_phone_state.


      Request Attributes

      Content format: JSON

      ParameterDescriptionRequiredExample Value
      permissionName of the parameter for whom permission is requested (Array of string)Yes'camera, record_audio'

      Response Attributes

      Success:

      Note: Response comes in json with 'data' as key
      ParameterDescriptionExample Value
      data.cameraValue of parameter passed in permission1
      data.record_audioValue of parameter passed in permission0

      RESPONSE CODES

      codeDescription
      -1not_determined, (applicable to iOS)
      0denied/unauthorised,
      1authorized

      Error Responses:

      ParameterDescriptionExample Value
      errorError2
      messageError messagefainavlid parameterlse

      ERROR CODES

      codeDescription
      2Invalid Parameters


      Request CodeResponse JSON
      
                  const requestObject={
                       permission: 'camera, record_audio'
               }
               
                   JSBridge.call('paytmRequestPermission',requestObject,
                    function(result) {
                      console.log(JSON.stringify(result))
                  });