'Firebase security rules with Facebook and Twitter APIs

i have android app with used Firebase as database, there are security rules should be added in Firebase platform, i tried to them, but when i added the below code, the app dont work good with Facebook/Twitter get friends permission, that is no friends shown in my app. So i think there are special code which be there so it will work good. My database database tree tree is attached in the picture. User treethere are folders inside MYCONTACTS and myfriends folders, is this need to be added? here is the picture

{

  "rules": {
      // Allow anyone to read data in User folder, but only authenticated content owners can
      // make changes to their data
    "USER": {      
         ".read": "auth != null",
       "$uid": {
        ".write": "auth.uid == $uid"
      }
    },
      // Allow anyone authenticated to read data in MyApps folder, but only authenticated content owners can
      // make changes to their data
       "MYAPPS": {
                  ".read": "auth != null",
      "$uid": {
        ".write": "auth.uid == $uid"
      }
    },
       // Allow anyone log in to read data in APPICONS folder,
       "APPICONS": {
        ".read": "auth.uid != null",
        ".write": "auth.uid != null"
    },
      // Allow anyone authenticated to read data in MYFRIENDS folder, but only authenticated content owners can
      // make changes to their data
       "MYFRIENDS": {
        ".read": "auth != null",
        ".write": "auth != null"   
         
    },
      // Allow only authenticated content owners can to read data in MYCONTACTS folder
      // make changes to their data
       "MYCONTACTS": {
         ".read": "auth != null",
      "$uid": {
        ".write": "auth.uid == $uid"
      }
    },
      // Allow anyone authenticated to read data in NOTIFICATION folder, but only authenticated content owners can
      // make changes to their data
       "NOTIFICATION": {
                  ".read": "auth != null",
             ".write": "auth != null"

    }
   },
      
      // Allow anyone authenticated to read data in Tokens folder, but only authenticated content owners can
      // make changes to their data
       "Tokens": {
                  ".read": "auth != null",
      "$uid": {
        ".write": "auth.uid == $uid"
        
      }
    }
  }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source